diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 935a831..b534e69 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -30,21 +30,11 @@
 
 extern int dirname_main(int argc, char **argv)
 {
-	char* s;
-
 	if ((argc < 2) || (**(argv + 1) == '-'))
 		show_usage();
 	argv++;
 
-	s=*argv+strlen(*argv)-1;
-	while (s > *argv && *s == '/') {
-		*s-- = '\0';
-	}
-	s = strrchr(*argv, '/');
-	if (s != NULL && s == *argv)
-		s[1] = '\0';
-	else if (s != NULL)
-		*s = '\0';
-	puts(s ? *argv : ".");
+	puts (dirname (argv[0]));
+
 	return EXIT_SUCCESS;
 }
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index d78f57e..03c49f0 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -2,8 +2,7 @@
 /*
  * Mini mkdir implementation for busybox
  *
- * Copyright (C) 1999,2000,2001 by Lineo, inc.
- * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,79 +20,45 @@
  *
  */
 
-#include <stdio.h>
 #include <errno.h>
-#include <string.h>
+#include <getopt.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
+
 #include "busybox.h"
 
-
-static int parentFlag = FALSE;
-static mode_t mode = 0777;
-
-
-extern int mkdir_main(int argc, char **argv)
+extern int mkdir_main (int argc, char **argv)
 {
-	int i = FALSE;
+	mode_t mode = -1;
+	int flags = 0;
+	int status = 0;
+	int i, opt;
 
-	argc--;
-	argv++;
-
-	/* Parse any options */
-	while (argc > 0 && **argv == '-') {
-		while (i == FALSE && *++(*argv)) {
-			switch (**argv) {
-			case 'm':
-				if (--argc == 0)
-					show_usage();
-				/* Find the specified modes */
-				mode = 0;
-				if (parse_mode(*(++argv), &mode) == FALSE) {
-					error_msg_and_die("Unknown mode: %s", *argv);
-				}
-				/* Set the umask for this process so it doesn't 
-				 * screw up whatever the user just entered. */
-				umask(0);
-				i = TRUE;
-				break;
-			case 'p':
-				parentFlag = TRUE;
-				break;
-			default:
-				show_usage();
-			}
+	while ((opt = getopt (argc, argv, "m:p")) != -1) {
+		switch (opt) {
+		case 'm':
+			mode = 0777;
+			if (!parse_mode (optarg, &mode))
+				error_msg_and_die ("invalid mode `%s'", optarg);
+			break;
+		case 'p':
+			flags |= FILEUTILS_RECUR;
+			break;
+		default:
+			show_usage ();
 		}
-		argc--;
-		argv++;
 	}
 
-	if (argc < 1) {
-		show_usage();
-	}
+	if (optind == argc)
+		show_usage ();
 
-	while (argc > 0) {
-		int status;
-		struct stat statBuf;
-		char buf[BUFSIZ + 1];
+	for (i = optind; i < argc; i++)
+		if (make_directory (argv[i], mode, flags) < 0)
+			status = 1;
 
-		if (strlen(*argv) > BUFSIZ - 1) {
-			error_msg_and_die(name_too_long);
-		}
-		strcpy(buf, *argv);
-		status = stat(buf, &statBuf);
-		if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
-			error_msg_and_die("%s: File exists", buf);
-		}
-		if (parentFlag == TRUE) {
-			strcat(buf, "/");
-			create_path(buf, mode);
-		} else {
-			if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
-				perror_msg_and_die(buf);
-			}
-		}
-		argc--;
-		argv++;
-	}
-	return EXIT_SUCCESS;
+	return status;
 }
