diff options
Diffstat (limited to 'daemon/tar.c')
-rw-r--r-- | daemon/tar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/daemon/tar.c b/daemon/tar.c index ebcaded8..bb0e4830 100644 --- a/daemon/tar.c +++ b/daemon/tar.c @@ -88,7 +88,8 @@ do_tar_in (const char *dir) if (pclose (fp) != 0) { err = errno; - cancel_receive (); + if (r == -1) /* if r == 0, file transfer ended already */ + cancel_receive (); errno = err; reply_with_perror ("pclose: %s", dir); return -1; @@ -209,7 +210,8 @@ do_tgz_in (const char *dir) if (pclose (fp) != 0) { err = errno; - cancel_receive (); + if (r == -1) /* if r == 0, file transfer ended already */ + cancel_receive (); errno = err; reply_with_perror ("pclose: %s", dir); return -1; |