diff options
author | Suleiman Souhlal <ssouhlal@FreeBSD.org> | 2005-01-26 06:39:20 +0000 |
---|---|---|
committer | Suleiman Souhlal <ssouhlal@FreeBSD.org> | 2005-01-26 06:39:20 +0000 |
commit | 379b60989ad02fccdb8c87dfbbabde04435de5c9 (patch) | |
tree | aa65f087fd37d42bd4480f3e739369e8ce2d09b9 /usr.bin/fsync | |
parent | 72217cb810da6724220f06bcfd43fd58b3c5fe53 (diff) |
In case of error, return errno, instead of 1.
Suggested by: delphij
Reviewed by: delphij
Approved by: grehan (mentor)
Notes
Notes:
svn path=/head/; revision=140847
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 764e79db3efd..543356f00a99 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); } |