]> granicus.if.org Git - zfs/commit
Set errno for mkdirp() called with NULL path ptr
authorChris Dunlap <cdunlap@llnl.gov>
Tue, 8 Apr 2014 22:31:11 +0000 (15:31 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Apr 2014 20:32:22 +0000 (13:32 -0700)
commit7368eb621e6c94dd8fd37020568f32c120afabf9
tree8a12d4c1cdad7282c8922936aa3ee3a78b8ef9c2
parentcc9ee13e1a36511decb526bf84146e20a846b3d6
Set errno for mkdirp() called with NULL path ptr

If mkdirp() is called with a NULL ptr for the path arg, it will return
-1 with errno unchanged.  This is unexpected since on error it should
return -1 and set errno to one of the error values listed for mkdir(2).

This commit sets errno = ENOENT for this NULL ptr case.  This is in
accordance with the errors specified by mkdir(2):

  ENOENT
  A component of the path prefix does not exist or is a null pathname.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2248
lib/libspl/mkdirp.c