chiark / gitweb /
move syslog wrapper to libudev
[elogind.git] / extras / collect / collect.c
index 355b85b5cfdb6199c63caa95bb1c5acf3b1d33a9..3284c3df40209a11cbe052fb188757f2f69d5391 100644 (file)
@@ -31,8 +31,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "../../udev/lib/libudev.h"
-#include "../../udev/lib/libudev-private.h"
+#include "libudev.h"
+#include "libudev-private.h"
 
 #define TMPFILE                        UDEV_PREFIX "/dev/.udev/collect"
 #define BUFSIZE                        16
 
 #define TMPFILE                        UDEV_PREFIX "/dev/.udev/collect"
 #define BUFSIZE                        16
@@ -171,8 +171,7 @@ static int checkout(int fd)
                                if (debug)
                                        fprintf(stderr, "Found word %s\n", word);
                                him = malloc(sizeof (struct _mate));
                                if (debug)
                                        fprintf(stderr, "Found word %s\n", word);
                                him = malloc(sizeof (struct _mate));
-                               him->name = malloc(strlen(word) + 1);
-                               strcpy(him->name, word);
+                               him->name = strdup(word);
                                him->state = STATE_OLD;
                                udev_list_node_append(&him->node, &bunch);
                                word = NULL;
                                him->state = STATE_OLD;
                                udev_list_node_append(&him->node, &bunch);
                                word = NULL;