diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 5 | ||||
-rw-r--r-- | coreutils/mkdir.c | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 6494857..a2dc1c3 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -29,10 +29,15 @@ #include "internal.h" +#include <features.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> +#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1) #include <inttypes.h> +#else +typedef unsigned long long int uintmax_t; +#endif static const char dd_usage[] = "dd [if=name] [of=name] [bs=n] [count=n]\n\n" diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 2cd1788..9ea3b4e 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -80,17 +80,21 @@ extern int mkdir_main(int argc, char **argv) while (argc > 0) { int status; struct stat statBuf; - status=stat(*argv, &statBuf); + char buf[NAME_MAX]; + + strcpy (buf, *argv); + status=stat(buf, &statBuf); if (status != -1 && status != ENOENT ) { - fprintf(stderr, "%s: File exists\n", *argv); + fprintf(stderr, "%s: File exists\n", buf); exit( FALSE); } if (parentFlag == TRUE) { - createPath(*argv, mode); + strcat( buf, "/"); + createPath(buf, mode); } else { - if (mkdir (*argv, mode) != 0) { - perror(*argv); + if (mkdir (buf, mode) != 0) { + perror(buf); exit( FALSE); } } |