summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>2002-05-28 15:42:51 +0000
committerDavid Dykstra <dwd@samba.org>2002-05-28 15:42:51 +0000
commit8e34cd41f0a361d0f389aedb5527c0972986ab56 (patch)
tree8aba370fb4b7b5188b3c3c74a216be54c4b562b4 /receiver.c
parent9ef1cc7cdf50dbb61f13f2d9b314bb7f1c2703ed (diff)
downloadrsync-8e34cd41f0a361d0f389aedb5527c0972986ab56.tar.gz
Close previously opened file descriptor when mkstemp fails in recv_files().
Every other failure condition in that function was alreadying doing this, and I saw a case with a lot of "mkstemp...No space left on device" messages started becoming "mkstemp...Too many open files" messages because of this bug. Not that it makes a whole lot of difference, since nothing gets copied because the disk was out of space.
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/receiver.c b/receiver.c
index 14282338..a4a3383d 100644
--- a/receiver.c
+++ b/receiver.c
@@ -429,6 +429,7 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
rprintf(FERROR,"mkstemp %s failed: %s\n",fnametmp,strerror(errno));
receive_data(f_in,buf,-1,NULL,file->length);
if (buf) unmap_file(buf);
+ if (fd1 != -1) close(fd1);
continue;
}