aboutsummaryrefslogtreecommitdiff
path: root/lib/fstream
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-30 17:54:33 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-30 17:57:30 +0200
commit7c6c0c07dda1f44b930ee2dbb9451979b6a2cb83 (patch)
tree1c9c3c7b1f81f4c7f425d17d197941bd3dece60e /lib/fstream
parentd92098b92dad44eeb4bf40bfca8818bd2d660a99 (diff)
Fix: don't throw an error if fsync() returns EINVAL
This indicates that sync isn't possible on the underlying file descriptor (e.g. a pipe), which currently causes sqfs2tar to err if the output isn't written directly to a file. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstream')
-rw-r--r--lib/fstream/unix/ostream.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/fstream/unix/ostream.c b/lib/fstream/unix/ostream.c
index 84a5725..17f1998 100644
--- a/lib/fstream/unix/ostream.c
+++ b/lib/fstream/unix/ostream.c
@@ -74,8 +74,11 @@ static int file_flush(ostream_t *strm)
goto fail;
}
- if (fsync(file->fd) != 0)
+ if (fsync(file->fd) != 0) {
+ if (errno == EINVAL)
+ return 0;
goto fail;
+ }
return 0;
fail: