chiark / gitweb /
[PATCH] change default perms of misc/rtc to be readable by anyone.
[elogind.git] / udevstart.c
index 7e19c379a503ed8ff7f2885dd419ffd236f3157b..1d9b60464c32749c2a72050996dfd9a29500a7b3 100644 (file)
@@ -62,8 +62,8 @@ static void udev_exec(const char *path, const char* subsystem)
        char nosleep[] = "UDEV_NO_SLEEP=1";
        char *env[] = { action, devpath, nosleep, NULL };
 
-       strcpy(action, "DEVPATH=%s");
-       strfieldcat(action, path);
+       strcpy(devpath, "DEVPATH=");
+       strfieldcat(devpath, path);
 
        pid = fork();
        switch (pid) {
@@ -130,10 +130,13 @@ static void udev_scan(void)
                                                                udev_exec(filename, "block");
                                                        }
                                                }
+                                               closedir(dir3);
                                        }
                                }
+                               closedir(dir2);
                        }
                }
+               closedir(dir);
        }
 
        devpath = "class";
@@ -176,10 +179,13 @@ static void udev_scan(void)
                                                                udev_exec(filename, dent->d_name);
                                                        }
                                                }
+                                               closedir(dir3);
                                        }
                                }
+                               closedir(dir2);
                        }
                }
+               closedir(dir);
        }
 }