diff options
author | ssouhlal <ssouhlal@FreeBSD.org> | 2005-01-26 06:39:20 +0000 |
---|---|---|
committer | ssouhlal <ssouhlal@FreeBSD.org> | 2005-01-26 06:39:20 +0000 |
commit | df36be78f56998c58b699045d2f50015611828cf (patch) | |
tree | aa65f087fd37d42bd4480f3e739369e8ce2d09b9 /usr.bin/fsync | |
parent | 570c92596512e3d385f3bcc174172b3a6bbece3a (diff) | |
download | FreeBSD-src-df36be78f56998c58b699045d2f50015611828cf.zip FreeBSD-src-df36be78f56998c58b699045d2f50015611828cf.tar.gz |
In case of error, return errno, instead of 1.
Suggested by: delphij
Reviewed by: delphij
Approved by: grehan (mentor)
Diffstat (limited to 'usr.bin/fsync')
-rw-r--r-- | usr.bin/fsync/fsync.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/fsync/fsync.c b/usr.bin/fsync/fsync.c index 764e79d..543356f 100644 --- a/usr.bin/fsync/fsync.c +++ b/usr.bin/fsync/fsync.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> +#include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> @@ -52,13 +53,13 @@ main(int argc, char *argv[]) for (i = 1; i < argc; ++i) { if ((fd = open(argv[i], O_RDONLY)) < 0) { warn("open %s", argv[i]); - rval = 1; + rval = errno; continue; } if (fsync(fd) != 0) { warn("fsync %s", argv[i]); - rval = 1; + rval = errno; } close(fd); } |