linux-2.6.26-rc1, mkdir -p

John Gumb john.gumb at tandberg.com
Sat May 17 16:53:55 PDT 2008


Folks

 

FWIW

 

Mkdir -p seems broken by linux-2.6.26...it's now returning EROFS at
filesystem mount points. So things like mkdir -p /var/log fail if var is
a ramdrive or something. The following seems to fix it. Whether this is
a kernel bug I don't know. It's certainly a change in behaviour.

 

--- libbb/make_directory.c.orig 2008-05-18 00:33:24.000000000 +0100

+++ libbb/make_directory.c      2008-05-18 00:34:37.000000000 +0100

@@ -65,7 +65,7 @@

                if (mkdir(path, 0777) < 0) {

                        /* If we failed for any other reason than the
directory

                         * already exists, output a diagnostic and
return -1.*/

-                       if (errno != EEXIST

+                       if ( ((errno != EEXIST) && (errno != EROFS))

                                || !(flags & FILEUTILS_RECUR)

                                || (stat(path, &st) < 0 ||
!S_ISDIR(st.st_mode))) {

                                fail_msg = "create";

cheers

 

John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/busybox/attachments/20080518/cd0740d2/attachment.htm 


More information about the busybox mailing list