fsync,sync: make them similar
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 2 Apr 2019 12:39:56 +0000 (14:39 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 2 Apr 2019 12:39:56 +0000 (14:39 +0200)
commit4f74bb6059b54df31b9a6cdaf844112a7003b0ff
treeeb4ed2d1463644e60fd8cc77704ff8546f951c25
parente48559eae3ba10e4b4f4c2ce726c31fd038a37ba
fsync,sync: make them similar

sync: add O_NOCTTY
fsync: drop O_NOATIME, add O_NONBLOCK, set exitcode to 1 if fsync() fails,
    update --help message to be similar to sync.
both: reformat code to minimize "diff -u sync.c fsync.c":
    in particular, they use same open() flags now

function                                             old     new   delta
fsync_main                                           126     130      +4
packed_usage                                       33316   33317      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 5/0)                 Total: 5 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/fsync.c
coreutils/sync.c