summaryrefslogtreecommitdiff
path: root/lib/utime.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-09-10 06:33:25 +0000
committerJim Meyering <jim@meyering.net>2003-09-10 06:33:25 +0000
commitb24bc317c5606518b8cdcc70efe26d1f4cbbfeb8 (patch)
tree14433fbc979be19a27522edce48f856549bb40c8 /lib/utime.c
parent6247161d8cfb83ae077032a15c164edab55ddc4d (diff)
downloadcoreutils-b24bc317c5606518b8cdcc70efe26d1f4cbbfeb8.tar.xz
[!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
(utime_null): Fix typo: 'st' was sometimes called 'sb'.
Diffstat (limited to 'lib/utime.c')
-rw-r--r--lib/utime.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/utime.c b/lib/utime.c
index f7107abdd..25657eea9 100644
--- a/lib/utime.c
+++ b/lib/utime.c
@@ -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