summaryrefslogtreecommitdiffstats
path: root/bin/mkdir/mkdir.c
Commit message (Collapse)AuthorAgeFilesLines
* Add missing static qualifierseadler2013-04-271-2/+2
| | | | | Reviewed by: ed, jilles MFC After: 3 days
* Put some static keywords in the source code.ed2011-10-311-1/+1
| | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis.
* Adhere to POSIX: the -m option only applies to the newly createdru2006-10-101-13/+21
| | | | | | | directories; it should not change the permission bits of already existing directories. Submitted by: Alex Unleashed (modified by me)
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-091-1/+2
|
* - The first argument of getmode() is a void *ssouhlal2005-01-251-1/+2
| | | | | | | - Add WARNS?= 6 Approved by: stefanf, grehan (mentor) Obtained from: DragonFlyBSD
* /*- or .\"- or #- to begin license clauses.imp2005-01-101-1/+1
|
* Don't read the byte at *argv[strlen(*argv) + 1].das2004-09-241-1/+1
| | | | PR: 71743
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Quiet warnings about copyright[].obrien2003-05-011-2/+2
|
* Consistently use __FBSDIDobrien2002-06-301-2/+2
|
* Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) systemsobomax2002-02-251-1/+1
| | | | | | | call returns `EISDIR', not `EEXIST', so that be prepared for that. This should fix number of ports, that often call `mkdir -p //usr/local/foobar'. This is just a quick workaround, the real fix would be either to avoid calling mkdir("/", ...) or fix VFS code to return consistent errno for this case.
* Fix warnings inspired by lint, a commercial lint and WARNS=4.markm2002-02-221-4/+4
|
* Fix the race between the stat() and the mkdir().zarzycki2002-02-051-16/+19
| | | | Reviewed by: jkh
* o __P has been reovedimp2002-02-021-10/+5
| | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are.
* Silence WARNS=2 and BDECFLAGS except for stupid mode_t warnings.kris2001-05-201-0/+1
| | | | MFC after: 1 week
* Special case the error reporting when errno is ENOTDIR or ENOENT.alfred2001-01-141-1/+5
| | | | | | | | This makes "mkdir /nonexistant/foo" complain that /nonexistant doesn't exist rather than /nonexistant/foo which doesn't make much sense. Submitted (in a different form) by: W.H.Scholten <whs@xs4all.nl>
* brucify and add comment about -v being non-standard to manpagemharo1999-09-041-4/+5
| | | | Reviewed by: obrien
* add verbose flagmharo1999-08-281-5/+14
| | | | Reviewed by: obrien
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Free memory obtained from setmode.imp1998-12-161-1/+2
| | | | Obtained from: OpenBSD
* Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"msmith1998-10-231-6/+8
| | | | | | with Bruce again. Reported by: bde
* Honour the spirit rather than the implementation of the previous changes;msmith1998-10-221-19/+10
| | | | | if we are invoked with -m, use chmod() on the final directory component in order to ensure the mode is correctly set.
* Make this compile, and honour the spirit of the original design whilemsmith1998-10-201-8/+10
| | | | | | | incorporating the intended fix. Attempt to address some of the putative style bugs introduced. Others doubtless remain. Embarrassed by: bde
* - mkdir -m should call chmod because the high-order bits get ignoredmsmith1998-10-201-1/+19
| | | | | | by the kernel as a security feature of some sort. Submitted by: Wilfredo Sanchez <wsanchez@apple.com>
* correct use of .Nm. Add rcsid.charnier1998-05-151-3/+5
|
* Fix several problems with mkdir:mpp1997-04-011-29/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Fix mkdir -p to exit with the proper exit status and issue an error message if it was unable to create all of the specified directories and they did not previously exist. POSIX says: The mkdir utility shall exit with one of the following values: 0 All the specified directories were created successfully or the -p option was specified and all the specified directories now exist. E.g. % mkdir -p /var/mkdir mkdir: /var/mkdir: Permission denied % touch /tmp/file % mkdir -p /tmp/file/dir mkdir: /tmp/file: Not a directory Previously the above examples would exit with a zero exit status and no error message. Something like the following run as a normal user will still not produce an error: % id uid=629(mpp) gid=629(mpp).... % mkdir -p /usr/local/etc % ls -ld /usr/local/etc drwxr-xr-x 4 bin bin 512 Dec 26 14:55 /usr/local/etc/ 2) Cleaned up the mode handling to be more efficient when multiple directories are being created. 3) Fixed a problem where directories could be created with the wrong mode if the the -p option was specified and the build() routine returned and error. It would leave the umask set incorrectly at this point. 4) Removed an unused variable. Closes PR# 2304.
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-281-2/+2
| | | | posix standard on the topic.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Cleanup man page and -Wall cleaning.steve1996-12-141-3/+3
|
* Added $Id$dg1994-09-241-0/+2
|
* Remove bogus cast that was introduced in the previous commit.bde1994-09-211-1/+1
|
* Applied patch to make -Wall and -Dlint shut up.phk1994-09-201-3/+4
| | | | | Reviewed by: phk Submitted by: Josef Grosch <joeg@gagme.wwa.com>
* [ From Dave Tweten ]jkh1994-09-081-2/+4
| | | | | | | | | | | | | | | | | POSIX.2 looks pretty unequivocal to me, and it agrees with you. Under the explanation of the "-p" option, it says, "Each dir operand that names an existing directory shall be ignored without error." Under the explanation of exit status zero, it says, "All the specified directories were created successfully, or the-p option was specified and all the specified directories now exist." Seems to me POSIX requires exactly the behavior you want. [ And I've made the change, which is also now compatible with 1.x - jkh ] Reviewed by: jkh Submitted by: jkh/tweten
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+169
OpenPOWER on IntegriCloud