summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-25 15:13:10 +0000
committerJim Meyering <jim@meyering.net>1999-01-25 15:13:10 +0000
commitf525fd81ca4589d2ba1761a0ab1d2da3e84c895d (patch)
tree16e23321ca2b919d81ca415899355c3ac5b01683 /src
parent89826ef42016c0ead8a1e4728d40757da70ebd34 (diff)
downloadcoreutils-f525fd81ca4589d2ba1761a0ab1d2da3e84c895d.tar.xz
(isaac_seed): Guard clock_gettime with test of
HAVE_CLOCK_GETTIME, not CLOCK_REALTIME. (wipename): Rename local dirfd to dir_fd to avoid shadowing the function declared in Linux's dirent.h.
Diffstat (limited to 'src')
-rw-r--r--src/shred.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shred.c b/src/shred.c
index 16cf4242c..8ca8df388 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -372,7 +372,7 @@ isaac_seed (struct isaac_state *s)
s->mm[1] = getppid ();
{
-#ifdef CLOCK_REALTIME /* POSIX ns-resolution */
+#ifdef HAVE_CLOCK_GETTIME /* POSIX ns-resolution */
struct timespec ts;
clock_gettime (CLOCK_REALTIME, &ts);
s->mm[2] = ts.tv_sec;
@@ -1153,7 +1153,7 @@ wipename (char *oldname, struct Options const *flags)
char *base; /* Pointer to filename component, after directories. */
unsigned len;
int err;
- int dirfd; /* Try to open directory to sync *it* */
+ int dir_fd; /* Try to open directory to sync *it* */
if (flags->verbose)
pfstatus (_("%s: deleting"), oldname);
@@ -1181,12 +1181,12 @@ wipename (char *oldname, struct Options const *flags)
if (base)
{
*base = '\0';
- dirfd = open (newname, O_RDONLY);
+ dir_fd = open (newname, O_RDONLY);
*base = '/';
}
else
{
- dirfd = open (".", O_RDONLY);
+ dir_fd = open (".", O_RDONLY);
}
base = base ? base + 1 : newname;
len = strlen (base);
@@ -1200,7 +1200,7 @@ wipename (char *oldname, struct Options const *flags)
if (access (newname, F_OK) < 0
&& !rename (oldname, newname))
{
- if (dirfd < 0 || fdatasync (dirfd) < 0)
+ if (dir_fd < 0 || fdatasync (dir_fd) < 0)
sync (); /* Force directory out */
if (origname)
{
@@ -1221,9 +1221,9 @@ wipename (char *oldname, struct Options const *flags)
}
free (newname);
err = remove (oldname);
- if (dirfd < 0 || fdatasync (dirfd) < 0)
+ if (dir_fd < 0 || fdatasync (dir_fd) < 0)
sync ();
- close (dirfd);
+ close (dir_fd);
if (origname)
{
if (!err && flags->verbose)