chiark / gitweb /
[PATCH] remove compiler warning from udevd.c
[elogind.git] / udevstart.c
index 40dbaf2475bcadc9006aabbad0f973bc33bfd250..5e6606d535ac4fc5de658a3f3c5b2f08ffb35ee0 100644 (file)
 #include <ctype.h>
 #include <dirent.h>
 #include <sys/wait.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #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(devpath, "DEVPATH=");
+       strfieldcat(devpath, path);
 
        pid = fork();
        switch (pid) {