]> git.pond.sub.org Git - empserver/commitdiff
Fix files and fairland to report ef_open() failure just once
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 29 Oct 2011 18:52:33 +0000 (20:52 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:05 +0000 (11:47 +0100)
ef_open() already reports failure since commit 7eb2fe57, v4.2.20.
Drop the second report from its callers.

src/util/fairland.c
src/util/files.c

index fcaf94f75cf4f8998cf3ae623a627a2068bebc6d..069796e7039fa235a0fc1b418a2832fc2c6d7ec6 100644 (file)
@@ -260,10 +260,8 @@ main(int argc, char *argv[])
        fprintf(stderr, "Can't chdir to %s (%s)\n", gamedir, strerror(errno));
        exit(EXIT_FAILURE);
     }
-    if (!ef_open(EF_SECTOR, EFF_MEM | EFF_NOTIME)) {
-       perror("ef_open");
+    if (!ef_open(EF_SECTOR, EFF_MEM | EFF_NOTIME))
        exit(1);
-    }
     write_sects();
     qprint("writing to sectors file...\n");
     if (!ef_close(EF_SECTOR))
index 10bf5d2fb3bbd9c09ef7b568650d6582d442297d..c76d6d4f6b63ff2c43c152d2b7e13977a95b4ed6 100644 (file)
@@ -130,10 +130,8 @@ main(int argc, char *argv[])
     for (i = 0; i < EF_MAX; i++) {
        if (!EF_IS_GAME_STATE(i))
            continue;
-       if (!ef_open(i, EFF_CREATE | EFF_NOTIME)) {
-           perror("ef_open");
+       if (!ef_open(i, EFF_CREATE | EFF_NOTIME))
            exit(1);
-       }
     }
 
     ef_read(EF_NATION, 0, &nat);