From: Art Cancro Date: Thu, 18 Nov 2010 02:55:12 +0000 (-0500) Subject: Only move from spooltmp to spoolin if there's actually something there. X-Git-Tag: v8.01~252^2~322 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=758283033429e35fa9d99ffea599b6d2fb3a594b;p=citadel.git Only move from spooltmp to spoolin if there's actually something there. --- diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index 679b9f44c..d0ab94092 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -2026,18 +2026,20 @@ void receive_spool(int *sock, char *remote_nodename) { unlink(tempfilename); return; } + + CtdlLogPrintf(CTDL_DEBUG, "%s\n", buf); if (download_len > 0) { CtdlLogPrintf(CTDL_NOTICE, "Received %ld octets from <%s>\n", download_len, remote_nodename); + /* + * Now move the temp file to its permanent location. + */ + if (link(tempfilename, permfilename) != 0) { + CtdlLogPrintf(CTDL_ALERT, "Could not link %s to %s: %s\n", + tempfilename, permfilename, strerror(errno) + ); + } } - CtdlLogPrintf(CTDL_DEBUG, "%s\n", buf); - /* Now move the temp file to its permanent location. - */ - if (link(tempfilename, permfilename) != 0) { - CtdlLogPrintf(CTDL_ALERT, "Could not link %s to %s: %s\n", - tempfilename, permfilename, strerror(errno) - ); - } unlink(tempfilename); }