]> skyeroc.xyz Git - dgamelaunch/commitdiff
Don't stop executing the cmdqueue even if file copy fails
authorPasi Kallinen <paxed@alt.org>
Tue, 15 Jan 2008 22:01:44 +0000 (22:01 +0000)
committerPasi Kallinen <paxed@alt.org>
Tue, 15 Jan 2008 22:01:44 +0000 (22:01 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@423 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgl-common.c

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