Don't stop executing the cmdqueue even if file copy fails

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@423 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2008-01-15 22:01:44 +00:00
parent b57983ec56
commit 11b20c6b73
1 changed files with 3 additions and 3 deletions

View File

@ -157,14 +157,14 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
char buf[1024]; char buf[1024];
size_t bytes; size_t bytes;
/* FIXME: use nethack-themed error messages here, as per write_canned_rcfile() */ /* FIXME: use nethack-themed error messages here, as per write_canned_rcfile() */
if (!(newfile = fopen (p2, "w"))) return 1; if (!(newfile = fopen (p2, "w"))) break;
if (!(cannedf = fopen (p1, "r"))) return 1; if (!(cannedf = fopen (p1, "r"))) break;
while ((bytes = fread (buf, 1, 1024, cannedf)) > 0) { while ((bytes = fread (buf, 1, 1024, cannedf)) > 0) {
if (fwrite (buf, 1, bytes, newfile) != bytes) { if (fwrite (buf, 1, bytes, newfile) != bytes) {
if (ferror (newfile)) { if (ferror (newfile)) {
fclose (cannedf); fclose (cannedf);
fclose (newfile); fclose (newfile);
return 1; break;
} }
} }
} }