Bug#202243: utimes() broken
Package: libc6
Version: 2.3.2-1
Severity: important
Tags: patch
When using utimes() to set the timestamps on a file, they
always come out as the epoch (actually 1 second past the epoch :).
Reason is a thinko regarding operator precedence in C, patch below.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux click 2.4.22-pre5 #2 Mon Jul 14 22:39:42 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=C
Versions of packages libc6 depends on:
ii libdb1-compat 2.1.3-7
-- no debconf information
--- ./debian/patches/10_cvs.dpatch~ 2003-07-20 22:10:51.000000000
+0200
+++ ./debian/patches/10_cvs.dpatch 2003-07-20 22:12:13.000000000
+0200
@@ -107975,8 +107975,8 @@
+ if (tvp != NULL)
+ {
+ times = &buf;
-+ buf.actime = tvp[0].tv_sec + tvp[0].tv_usec >= 500000;
-+ buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec >= 500000;
++ buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec >= 500000);
++ buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec >= 500000);
+ }
+ else
+ times = NULL;
@@ -118962,8 +118962,8 @@
+ if (tvp != NULL)
+ {
+ times = &buf;
-+ buf.actime = tvp[0].tv_sec + tvp[0].tv_usec >= 500000;
-+ buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec >= 500000;
++ buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec >= 500000);
++ buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec >= 500000);
+ }
+ else
+ times = NULL;
Reply to: