(do_store): call closefunc before claiming that everything went ok, if
the close fails the file might not have been stored properly git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9792 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1187,18 +1187,22 @@ do_store(char *name, char *mode, int unique)
|
|||||||
goto done;
|
goto done;
|
||||||
set_buffer_size(fileno(din), 1);
|
set_buffer_size(fileno(din), 1);
|
||||||
if (receive_data(din, fout) == 0) {
|
if (receive_data(din, fout) == 0) {
|
||||||
|
if((*closefunc)(fout) < 0)
|
||||||
|
perror_reply(552, name);
|
||||||
|
else {
|
||||||
if (unique)
|
if (unique)
|
||||||
reply(226, "Transfer complete (unique file name:%s).",
|
reply(226, "Transfer complete (unique file name:%s).",
|
||||||
name);
|
name);
|
||||||
else
|
else
|
||||||
reply(226, "Transfer complete.");
|
reply(226, "Transfer complete.");
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
(*closefunc)(fout);
|
||||||
fclose(din);
|
fclose(din);
|
||||||
data = -1;
|
data = -1;
|
||||||
pdata = -1;
|
pdata = -1;
|
||||||
done:
|
done:
|
||||||
LOGBYTES(*mode == 'w' ? "put" : "append", name, byte_count);
|
LOGBYTES(*mode == 'w' ? "put" : "append", name, byte_count);
|
||||||
(*closefunc)(fout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static FILE *
|
static FILE *
|
||||||
|
Reference in New Issue
Block a user