| 1 | /* mkdir - make directories */
|
|---|
| 2 |
|
|---|
| 3 | /* See Makefile for compilation details. */
|
|---|
| 4 |
|
|---|
| 5 | #include <config.h>
|
|---|
| 6 |
|
|---|
| 7 | #include "bashtypes.h"
|
|---|
| 8 | #include "posixstat.h"
|
|---|
| 9 | #include <errno.h>
|
|---|
| 10 | #include <stdio.h>
|
|---|
| 11 | #include "bashansi.h"
|
|---|
| 12 | #if defined (HAVE_UNISTD_H)
|
|---|
| 13 | # include <unistd.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include "builtins.h"
|
|---|
| 17 | #include "shell.h"
|
|---|
| 18 | #include "bashgetopt.h"
|
|---|
| 19 |
|
|---|
| 20 | #if !defined (errno)
|
|---|
| 21 | extern int errno;
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
|
|---|
| 25 |
|
|---|
| 26 | extern int parse_symbolic_mode ();
|
|---|
| 27 |
|
|---|
| 28 | static int make_path ();
|
|---|
| 29 |
|
|---|
| 30 | static int original_umask;
|
|---|
| 31 |
|
|---|
| 32 | int
|
|---|
| 33 | mkdir_builtin (list)
|
|---|
| 34 | WORD_LIST *list;
|
|---|
| 35 | {
|
|---|
| 36 | int opt, pflag, omode, rval, octal, nmode, parent_mode, um;
|
|---|
| 37 | char *mode;
|
|---|
| 38 | WORD_LIST *l;
|
|---|
| 39 |
|
|---|
| 40 | reset_internal_getopt ();
|
|---|
| 41 | pflag = 0;
|
|---|
| 42 | mode = (char *)NULL;
|
|---|
|
|---|