In case of error, return errno, instead of 1. Requested by: delphij Index: src/usr.bin/fsync/fsync.c =================================================================== --- src/usr.bin/fsync/fsync.c (revision 150) +++ src/usr.bin/fsync/fsync.c (working copy) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD: src/usr.bin/fsync/fsync.c,v 1.4 2002/06/30 05:21:20 obrien Exp $"); #include +#include #include #include #include @@ -52,13 +53,13 @@ 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); }