Streamline a few files error messages

Write one nice line to stderr instead of a cryptic one to stderr, and
an uninformative one to stdout.
This commit is contained in:
Markus Armbruster 2011-10-29 21:06:36 +02:00
parent 73129c15cc
commit c9b380eee4

View file

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