From 6780c259cf2b5a89804a659c5e680a2c8801a012 Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Sat, 19 Jul 2025 14:47:41 -0300 Subject: [PATCH 1/2] [libc] Fix utimes build when full_build=OFF Same as PR #149665: we might pull a header from host where tv_nsec is not a long, so compilation would fail with an implicit conversion error. --- libc/src/sys/time/linux/utimes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/src/sys/time/linux/utimes.cpp b/libc/src/sys/time/linux/utimes.cpp index ed37b42aedf6c..36220d73e7c19 100644 --- a/libc/src/sys/time/linux/utimes.cpp +++ b/libc/src/sys/time/linux/utimes.cpp @@ -59,8 +59,8 @@ LLVM_LIBC_FUNCTION(int, utimes, ts[1].tv_sec = times[1].tv_sec; // convert u-seconds to nanoseconds - ts[0].tv_nsec = times[0].tv_usec * 1000; - ts[1].tv_nsec = times[1].tv_usec * 1000; + ts[0].tv_nsec = static_cast(times[0].tv_usec * 1000); + ts[1].tv_nsec = static_cast(times[1].tv_usec * 1000); ts_ptr = ts; } From 02f8d900d056e9c7fa9274cf835c01ffa6a1312a Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Sat, 19 Jul 2025 16:04:00 -0300 Subject: [PATCH 2/2] Code style Signed-off-by: Mikhail R. Gadelha --- libc/src/sys/time/linux/utimes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libc/src/sys/time/linux/utimes.cpp b/libc/src/sys/time/linux/utimes.cpp index 36220d73e7c19..9c00ce9909f2f 100644 --- a/libc/src/sys/time/linux/utimes.cpp +++ b/libc/src/sys/time/linux/utimes.cpp @@ -59,8 +59,10 @@ LLVM_LIBC_FUNCTION(int, utimes, ts[1].tv_sec = times[1].tv_sec; // convert u-seconds to nanoseconds - ts[0].tv_nsec = static_cast(times[0].tv_usec * 1000); - ts[1].tv_nsec = static_cast(times[1].tv_usec * 1000); + ts[0].tv_nsec = + static_cast(times[0].tv_usec * 1000); + ts[1].tv_nsec = + static_cast(times[1].tv_usec * 1000); ts_ptr = ts; }