Commit 8e34cd41 authored by David Dykstra's avatar David Dykstra

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.
parent 9ef1cc7c
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment