Patch from David Meggy to make the swap default to the new version if no
[oweals/busybox.git] / miscutils / devfsd.c
index a53328fab4d0d805f9134e294530c2835040b199..e5d550835907919713d835d6b7383050bc106641 100644 (file)
@@ -830,6 +830,9 @@ static void action_execute (const struct devfsd_notify_struct *info,
        char largv[MAX_ARGS + 1][STRING_LENGTH];
 
 #ifdef CONFIG_DEVFSD_DEBUG
+       int i;
+       char buff[1024];
+
        msg_logger( NO_DIE, LOG_INFO, "action_execute()\n");
 #endif
 
@@ -847,9 +850,6 @@ static void action_execute (const struct devfsd_notify_struct *info,
        argv[count] = NULL;
 
 #ifdef CONFIG_DEVFSD_DEBUG
-       int i;
-       char buff[1024];
-
        buff[0]='\0';
        for(i=0;argv[i]!=NULL;i++) /* argv[i] < MAX_ARGS + 1 */
        {
@@ -1426,15 +1426,14 @@ static int mksymlink (const char *oldpath, const char *newpath)
 
 static int make_dir_tree (const char *path)
 /*  [SUMMARY] Creating intervening directories for a path as required.
-    <path> The full pathname (including he leaf node).
+    <path> The full pathname (including the leaf node).
     [RETURNS] TRUE on success, else FALSE.
 */
 {
 #ifdef CONFIG_DEVFSD_DEBUG
        msg_logger( NO_DIE, LOG_INFO, "make_dir_tree()\n");
 #endif
-
-       if (bb_make_directory( (char *)path,  S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH , FILEUTILS_RECUR )==-1)
+       if (bb_make_directory( dirname((char *)path),  S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ,FILEUTILS_RECUR )==-1)
        {
 #ifdef CONFIG_DEVFSD_VERBOSE
                msg_logger( NO_DIE, LOG_ERR, "make_dir_tree(): %s: %m\n", path);