X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udevstart.c;h=7e19c379a503ed8ff7f2885dd419ffd236f3157b;hb=487c1b35ba1d0a2f76d99dc9b9454e2895f915bb;hp=21fd93df742b12776664bb10a4ebae1f5c23c11c;hpb=d00bd1724bd9f75f5a7b8e0368428c2f0d6d3c26;p=elogind.git diff --git a/udevstart.c b/udevstart.c index 21fd93df7..7e19c379a 100644 --- a/udevstart.c +++ b/udevstart.c @@ -29,8 +29,11 @@ #include #include #include +#include +#include #include "logging.h" +#include "udev_lib.h" #ifdef LOG @@ -59,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 }; - snprintf(devpath, MAX_PATHLEN, "DEVPATH=%s", path); - devpath[MAX_PATHLEN-1] = '\0'; + strcpy(action, "DEVPATH=%s"); + strfieldcat(action, path); pid = fork(); switch (pid) { @@ -78,12 +81,11 @@ static void udev_exec(const char *path, const char* subsystem) } } -static int udev_scan(void) +static void udev_scan(void) { char *devpath; DIR *dir; struct dirent *dent; - int retval = -EINVAL; devpath = "block"; dir = opendir(SYSBLOCK); @@ -179,11 +181,6 @@ static int udev_scan(void) } } } - - if (retval > 0) - retval = 0; - - return -retval; } @@ -191,5 +188,7 @@ int main(int argc, char *argv[], char *envp[]) { init_logging("udevstart"); - return udev_scan(); + udev_scan(); + + return 0; }