From: <d_s...@us...> - 2004-01-05 05:16:56
|
Update of /cvsroot/husky/hpt/src In directory sc8-pr-cvs1:/tmp/cvs-serv637/src Modified Files: Tag: hpt-1_4-stable toss.c Log Message: fixed renaming files when files are need to be moved across different partitions Index: toss.c =================================================================== RCS file: /cvsroot/husky/hpt/src/toss.c,v retrieving revision 1.490.2.5 retrieving revision 1.490.2.6 diff -u -d -r1.490.2.5 -r1.490.2.6 --- toss.c 28 Dec 2003 22:19:29 -0000 1.490.2.5 +++ toss.c 5 Jan 2004 05:16:48 -0000 1.490.2.6 @@ -1727,7 +1727,7 @@ xstrcat(&pkt, link->fileBox); xstrcat(&pkt, link->pktFile + strlen(config->tempOutbound)); - cmdexit = rename(link->pktFile, pkt); + cmdexit = move_file(link->pktFile, pkt, 0); if (cmdexit==0) w_log(LL_BUNDLE, "Leave non-packed mail for %s %s, %s", aka2str(link->hisAka), link->name, get_filename(link->pktFile)); @@ -1830,7 +1830,7 @@ xstrcat(&pkt, link->pktFile + strlen(config->tempOutbound)); - cmdexit = rename(link->pktFile, pkt); + cmdexit = move_file(link->pktFile, pkt, 0); if (cmdexit==0) { fprintf(flo, "^%s\n", pkt); w_log(LL_BUNDLE, "Leave non-packed mail for %s %s, %s", @@ -1926,7 +1926,7 @@ newname = safe_strdup(filename); strcpy(newname + l - 3, "pkt"); - if (rename(newname, filename) == 0) + if (move_file(newname, filename, 0) == 0) { strcpy(filename, newname); @@ -1935,7 +1935,10 @@ fwrite(buffer, 2, 1, f); fclose(f); } - } + } else + w_log(LL_ERR, "Failure moving %s to %s (%s)", newname, + filename, strerror(errno)); + nfree(newname); } } |