Home | History | Annotate | Download | only in mkdir
History log of /src/bin/mkdir/mkdir.c
RevisionDateAuthorComments
 1.39  13-Sep-2021  kre PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.
 1.38  29-Aug-2011  joerg branches: 1.38.36; 1.38.44; 1.38.46;
static + __dead
 1.37  20-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
 1.36  01-Oct-2005  christos branches: 1.36.20;
Fix setmode error handling.
 1.35  04-Jan-2004  jschauma remove unused code left from printescaped() backput as pointed out by Jeff
Ito in PR bin/23969 and PR bin/23970.
 1.34  14-Sep-2003  jschauma Following private discussion with kleink@ and hubertf@ and public discussion
on tech-userlevel@, back out printescaped() functionality.
kleink: ``We sell rope.''
 1.33  11-Sep-2003  christos Comment out unneeded code now that the kernel has been fixed to ignore
trailing slashes.
 1.32  13-Aug-2003  itojun use bounded string op
 1.31  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.30  04-Aug-2003  jschauma As discusses a little while back on tech-userlevel:

If stdout is a tty, use vis(3) to print any filenames to prevent garbage
from being printed if the filename contains control- or other non-printable
characters.

While here, sprinkle some EXIT_FAILURE and NOTREACHED where appropriate.
 1.29  10-Mar-2003  lukem Fix typo in mkpath()'s test before chmod().
Noted in [bin/20652] by Anthony Mallet.
 1.28  05-Mar-2003  lukem Rework -p support again;
- If mkdir() fails on a component (no matter what the error is),
stat() the result. If the stat() fails, print the error mkdir() generated.
Otherwise, if the result is not a directory, explicitly fail with ENOTDIR.
- Move the chmod() of last element to be done only if the mkdir() succeeded
(i.e, it wasn't an existing directory)

Fixes problem introduced in previous commit where "mkdir -p existing"
on a read-only file system would incorrectly return a non zero exit code,
whilst retaining the race-condition fix of the previous commit.

Thanks to simonb@ for sanity checking my fix versus the standards.
 1.27  24-Nov-2002  chs in mkpath(), don't try to stat() the to-be-created directory beforehand,
just try to create it and interpret any error appropriately.
this fixes a problem where multiple "mkdir -p" processes can race,
with the loser returning a spurious error.
 1.26  19-Feb-2002  enami Cosmetic changes.
 1.25  16-Sep-2001  wiz ANSIfy, KNF, use [gs]etprogname. By Petri Koistinen.
 1.24  10-Oct-2000  enami - The type of return value of setmode is a void * and getmode takes it,
rather than mode_t *.
- Free the storage allocated by setmode unless it is obvious that program
exits immediately.
 1.23  26-May-1999  kleink Change previous to use symbolic names for file modes. Also, clean up some
whitespace lossage and use EXIT_{SUCCESS,FAILURE}.
 1.22  25-May-1999  tron Only call chmod(2) if we create a directory with a mode which isn't
accepted by mkdir(2).
 1.21  13-Oct-1998  scw Insert a missing 'else' which caused mknod(2) to still be called
even if mkdir(2) failed. At best this caused two (different)
error messages to be printed. At worst, it changed the mode of
an existing file/directory.
 1.20  08-Oct-1998  wsanchez umask()/mkdir() system calls will not set the setuid bit; the kernel intentionally
discards the high bits, so "mkdir -m 1777 foo" won't set the sticky bit. So call
chmod() on the directory.
 1.19  28-Jul-1998  mycroft Delint.
 1.18  05-Nov-1997  cgd lint
 1.17  20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.16  09-Jan-1997  tls kill use of register
 1.15  12-Aug-1996  explorer Fix mkdir -p to not ignore terminal directory mode specified.
Closes pr bin/2686.
 1.14  25-Jun-1995  mycroft Style and format police.
 1.13  25-Jun-1995  mycroft Don't complain if a directory already exists. From Greg Hudson, but
slightly edited.
 1.12  21-Mar-1995  cgd clean up slightly; id tags, alphabetization, prototypes, etc.
 1.11  01-Mar-1995  jtc Revert to code before it was merged with 4.4lite.
Updated to conform to new NetBSD RCS ID conventions.
 1.10  22-Sep-1994  mycroft Merge 4.4-Lite version.
 1.9  29-Apr-1994  jtc Strip trailing slashes, to make "mkdir -p" work as specified by POSIX.2.
 1.8  28-Apr-1994  jtc simplify recursive directory create (mkdir -p) code
 1.7  31-Dec-1993  jtc Localization changes.
Updated to use standard error message routines.
 1.6  13-Oct-1993  jtc #include <unistd.h>, so getopt(), optarg, opterr, optind, and optopt
declarations can be removed from <stdlib.h>.
 1.5  01-Aug-1993  mycroft Add RCS identifiers.
 1.4  20-Jul-1993  jtc Make Posix 1003.2 (D11.2) compliant by adding -m (mode) option.
 1.3  23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2  22-Mar-1993  cgd added rcs ids to all files
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  22-Sep-1994  mycroft Import original 4.4-Lite version.
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.36.20.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.38.46.1  23-Sep-2021  martin Pull up following revision(s) (requested by kre in ticket #1347):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.
 1.38.44.2  21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.38.44.1  21-Apr-2020  martin Sync with HEAD
 1.38.36.1  23-Sep-2021  martin Pull up following revision(s) (requested by kre in ticket #1697):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.

RSS XML Feed