chiark / gitweb /
collect, keymap, systemctl: use _noreturn_
[elogind.git] / src / udev / collect / collect.c
index 076fe479e22720758879b2c16628aa9558c31e9c..80f464aff0040d9e67a34419a2445a8072e70882 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "libudev.h"
 #include "libudev-private.h"
+#include "macro.h"
 
 #define BUFSIZE                        16
 #define UDEV_ALARM_TIMEOUT        180
@@ -55,16 +56,12 @@ static int debug;
 /* This can increase dynamically */
 static size_t bufsize = BUFSIZE;
 
-static struct _mate *node_to_mate(struct udev_list_node *node)
+static inline struct _mate *node_to_mate(struct udev_list_node *node)
 {
-        char *mate;
-
-        mate = (char *)node;
-        mate -= offsetof(struct _mate, node);
-        return (struct _mate *)mate;
+        return container_of(node, struct _mate, node);
 }
 
-static void sig_alrm(int signo)
+_noreturn_ static void sig_alrm(int signo)
 {
         exit(4);
 }
@@ -405,7 +402,7 @@ int main(int argc, char **argv)
         if (debug)
                 fprintf(stderr, "Using checkpoint '%s'\n", checkpoint);
 
-        util_strscpyl(tmpdir, sizeof(tmpdir), udev_get_run_path(udev), "/collect", NULL);
+        util_strscpyl(tmpdir, sizeof(tmpdir), "/run/udev/collect", NULL);
         fd = prepare(tmpdir, checkpoint);
         if (fd < 0) {
                 ret = 3;