diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-30 17:54:33 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-30 17:57:30 +0200 |
commit | 7c6c0c07dda1f44b930ee2dbb9451979b6a2cb83 (patch) | |
tree | 1c9c3c7b1f81f4c7f425d17d197941bd3dece60e | |
parent | d92098b92dad44eeb4bf40bfca8818bd2d660a99 (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>
-rw-r--r-- | lib/fstream/unix/ostream.c | 5 |
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: |