(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; | ||||
| 	set_buffer_size(fileno(din), 1); | ||||
| 	if (receive_data(din, fout) == 0) { | ||||
| 	    if((*closefunc)(fout) < 0) | ||||
| 		perror_reply(552, name); | ||||
| 	    else { | ||||
| 		if (unique) | ||||
| 			reply(226, "Transfer complete (unique file name:%s).", | ||||
| 			    name); | ||||
| 		else | ||||
| 			reply(226, "Transfer complete."); | ||||
| 	} | ||||
| 	    } | ||||
| 	} else | ||||
| 	    (*closefunc)(fout); | ||||
| 	fclose(din); | ||||
| 	data = -1; | ||||
| 	pdata = -1; | ||||
| done: | ||||
| 	LOGBYTES(*mode == 'w' ? "put" : "append", name, byte_count); | ||||
| 	(*closefunc)(fout); | ||||
| } | ||||
|  | ||||
| static FILE * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Johan Danielsson
					Johan Danielsson