diff options
Diffstat (limited to 'src/udev/collect')
-rw-r--r-- | src/udev/collect/collect.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c index 6cf41c67bb..349585b634 100644 --- a/src/udev/collect/collect.c +++ b/src/udev/collect/collect.c @@ -19,13 +19,16 @@ * */ -#include <stdio.h> -#include <stddef.h> #include <errno.h> #include <getopt.h> +#include <stddef.h> +#include <stdio.h> +#include "alloc-util.h" #include "libudev-private.h" #include "macro.h" +#include "stdio-util.h" +#include "string-util.h" #define BUFSIZE 16 #define UDEV_ALARM_TIMEOUT 180 @@ -89,7 +92,7 @@ static int prepare(char *dir, char *filename) if (r < 0 && errno != EEXIST) return -errno; - snprintf(buf, sizeof(buf), "%s/%s", dir, filename); + xsprintf(buf, "%s/%s", dir, filename); fd = open(buf,O_RDWR|O_CREAT|O_CLOEXEC, S_IRUSR|S_IWUSR); if (fd < 0) @@ -364,7 +367,7 @@ int main(int argc, char **argv) goto exit; } - while (1) { + for (;;) { int option; option = getopt_long(argc, argv, "ardh", options, NULL); |