]> git.pond.sub.org Git - empserver/commitdiff
Streamline a few files error messages
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 29 Oct 2011 19:06:36 +0000 (21:06 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:05 +0000 (11:47 +0100)
Write one nice line to stderr instead of a cryptic one to stderr, and
an uninformative one to stdout.

src/util/files.c

index c76d6d4f6b63ff2c43c152d2b7e13977a95b4ed6..df12ab8550b70917c644483f773a1f64205af150 100644 (file)
@@ -110,12 +110,13 @@ main(int argc, char *argv[])
     empfile_fixup();
 
     if (mkdir(gamedir, S_IRWXU | S_IRWXG) < 0 && errno != EEXIST) {
-       perror(gamedir);
-       printf("Can't make game directory\n");
+       fprintf(stderr, "Can't make game directory %s (%s)\n",
+               gamedir, strerror(errno));
        exit(1);
     }
     if (chdir(gamedir)) {
-       fprintf(stderr, "Can't chdir to %s (%s)\n", gamedir, strerror(errno));
+       fprintf(stderr, "Can't chdir to %s (%s)\n",
+               gamedir, strerror(errno));
        exit(EXIT_FAILURE);
     }
 
@@ -144,8 +145,8 @@ main(int argc, char *argv[])
     ef_write(EF_NATION, 0, &nat);
     printf("All praise to %s!\n", nat.nat_cnam);
     if (mkdir(teldir, S_IRWXU | S_IRWXG) < 0 && errno != EEXIST) {
-       perror(teldir);
-       printf("Can't make telegram directory\n");
+       fprintf(stderr, "Can't make telegram directory %s (%s)\n",
+               teldir, strerror(errno));
        exit(1);
     }
     for (i = 0; i < MAXNOC; i++) {