From 7c6c0c07dda1f44b930ee2dbb9451979b6a2cb83 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 30 Mar 2021 17:54:33 +0200 Subject: 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 --- lib/fstream/unix/ostream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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: -- cgit v1.2.3