[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case |
Date: |
08 Sep 2003 15:36:10 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
While testing some other changes I noticed that utime.c won't build at
all in the !HAVE_UTIMES_NULL case. Perhaps we should stop checking
for HAVE_UTIMES_NULL if that feature is entirely obsolete? But in
the meantime I installed the following obvious fix.
2003-09-08 Paul Eggert <address@hidden>
* utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
(utime_null): Fix typo: 'st' was sometimes called 'sb'.
Index: utime.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/utime.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -p -u -r1.9 -r1.10
--- utime.c 22 Jul 2003 22:56:34 -0000 1.9
+++ utime.c 8 Sep 2003 22:32:00 -0000 1.10
@@ -27,6 +27,11 @@
# include <utime.h>
#endif
+#if !HAVE_UTIMES_NULL
+# include <sys/stat.h>
+# include <fcntl.h>
+#endif
+
#include "full-write.h"
#include "safe-read.h"
@@ -53,11 +58,11 @@ utime_null (const char *file)
int fd;
char c;
int status = 0;
- struct stat sb;
+ struct stat st;
fd = open (file, O_RDWR);
if (fd < 0
- || fstat (fd, &sb) < 0
+ || fstat (fd, &st) < 0
|| safe_read (fd, &c, sizeof c) == SAFE_READ_ERROR
|| lseek (fd, (off_t) 0, SEEK_SET) < 0
|| full_write (fd, &c, sizeof c) != sizeof c
- [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case,
Paul Eggert <=
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, Bruno Haible, 2003/09/09
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, Paul Eggert, 2003/09/09
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, Jim Meyering, 2003/09/09
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, James Youngman, 2003/09/09
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, Jim Meyering, 2003/09/09
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, James Youngman, 2003/09/10
- Re: [Bug-gnulib] utime.c patch for the !HAVE_UTIMES_NULL case, Jim Meyering, 2003/09/10