diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-05-23 12:09:33 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-05-23 12:09:33 +0000 |
commit | 1bcc04152afcff0ed7b48bc1b11b45519599da5d (patch) | |
tree | fbd3aab2d1e1a62369afc2e4428044a8bd66ee2a /libutil | |
parent | d31764b41b49a2d385a6b4f3da0bdfec713f0305 (diff) | |
download | pw-darwin-1bcc04152afcff0ed7b48bc1b11b45519599da5d.tar.gz pw-darwin-1bcc04152afcff0ed7b48bc1b11b45519599da5d.tar.zst pw-darwin-1bcc04152afcff0ed7b48bc1b11b45519599da5d.zip |
Nit: avoid shadowing truncate(2) with a local variable.
Diffstat (limited to 'libutil')
-rw-r--r-- | libutil/flopen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libutil/flopen.c b/libutil/flopen.c index b99055e..23742f7 100644 --- a/libutil/flopen.c +++ b/libutil/flopen.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); int flopen(const char *path, int flags, ...) { - int fd, operation, serrno, truncate; + int fd, operation, serrno, trunc; struct stat sb, fsb; mode_t mode; @@ -62,7 +62,7 @@ flopen(const char *path, int flags, ...) if (flags & O_NONBLOCK) operation |= LOCK_NB; - truncate = (flags & O_TRUNC); + trunc = (flags & O_TRUNC); flags &= ~O_TRUNC; for (;;) { @@ -94,7 +94,7 @@ flopen(const char *path, int flags, ...) close(fd); continue; } - if (truncate && ftruncate(fd, 0) != 0) { + if (trunc && ftruncate(fd, 0) != 0) { /* can't happen [tm] */ serrno = errno; close(fd); |