From 65225df2dc656d3c038b22e82b2865c1db333cb2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 31 Jan 2001 17:35:02 +0000 Subject: Cleanup patch from Vladimir N. Oleynik. * mkdir: remove 3 lines in source code. * mkfs_minix: save 32 bytes, remove 4 bugs. * mkswap: save 64 bytes, remove 1 bug. --- coreutils/mkdir.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'coreutils') diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 2345d8831..07b18713a 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -52,8 +52,7 @@ extern int mkdir_main(int argc, char **argv) /* Find the specified modes */ mode = 0; if (parse_mode(*(++argv), &mode) == FALSE) { - error_msg("Unknown mode: %s\n", *argv); - return EXIT_FAILURE; + error_msg_and_die("Unknown mode: %s\n", *argv); } /* Set the umask for this process so it doesn't * screw up whatever the user just entered. */ @@ -81,22 +80,19 @@ extern int mkdir_main(int argc, char **argv) char buf[BUFSIZ + 1]; if (strlen(*argv) > BUFSIZ - 1) { - error_msg(name_too_long); - return EXIT_FAILURE; + error_msg_and_die(name_too_long); } strcpy(buf, *argv); status = stat(buf, &statBuf); if (parentFlag == FALSE && status != -1 && errno != ENOENT) { - error_msg("%s: File exists\n", buf); - return EXIT_FAILURE; + error_msg_and_die("%s: File exists\n", buf); } if (parentFlag == TRUE) { strcat(buf, "/"); create_path(buf, mode); } else { if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { - perror(buf); - return EXIT_FAILURE; + perror_msg_and_die(buf); } } argc--; -- cgit v1.2.3