summaryrefslogtreecommitdiff
path: root/libc/src/sys/time/linux
diff options
context:
space:
mode:
authorMikhail R. Gadelha <mikhail@igalia.com>2025-07-19 16:37:42 -0300
committerGitHub <noreply@github.com>2025-07-19 16:37:42 -0300
commit5753be4ea29a01a601eeee7380a2f5a284711d7a (patch)
tree8a1b47c9d67571e3b584e9f4c241fd20bb8dba32 /libc/src/sys/time/linux
parent3fd53db8585749451a0686d651e753e8b23265cf (diff)
[libc] Fix utimes build when full_build=OFF (#149668)
We might pull a header from the host where tv_nsec is not a long, so compilation would fail with an implicit conversion error.
Diffstat (limited to 'libc/src/sys/time/linux')
-rw-r--r--libc/src/sys/time/linux/utimes.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/src/sys/time/linux/utimes.cpp b/libc/src/sys/time/linux/utimes.cpp
index ed37b42aedf6..9c00ce9909f2 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 = times[0].tv_usec * 1000;
- ts[1].tv_nsec = times[1].tv_usec * 1000;
+ ts[0].tv_nsec =
+ static_cast<decltype(ts[0].tv_nsec)>(times[0].tv_usec * 1000);
+ ts[1].tv_nsec =
+ static_cast<decltype(ts[1].tv_nsec)>(times[1].tv_usec * 1000);
ts_ptr = ts;
}