[Toybox] [PATCH] mkdir: return error for existing directories without -p flag

Mikhail Kashkarov m.kashkarov at samsung.com
Mon Oct 18 09:53:47 PDT 2021


Hello, we've noticed that mkdir returns 0 for already existed
directories (which was not expected behaviour), patch attached below.

# currently:
$ (./toybox mkdir d; ./toybox mkdir d); echo $?; ./toybox rmdir d
0

# expected:
$ (mkdir d; mkdir d); echo $?; rmdir d
mkdir: cannot create directory ‘d’: File exists
1

# patched:
$ (./toybox mkdir d; ./toybox mkdir d); echo $?; ./toybox rmdir d
mkdir: 'd': File exists
1

-- 
Mikhail K.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mkdir-return-error-for-existing-directories-without-.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20211018/a1c3209b/attachment-0002.bin>


More information about the Toybox mailing list