]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udevd.c
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
[thirdparty/systemd.git] / src / udev / udevd.c
index 28ac44fb8ebb6b1a278ce27d1cb2f27c070e9275..f1fc1cd0821eb67919e338add444510092f1b92f 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stddef.h>
-#include <signal.h>
-#include <unistd.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdbool.h>
 #include <string.h>
-#include <fcntl.h>
-#include <getopt.h>
+#include <sys/epoll.h>
 #include <sys/file.h>
-#include <sys/time.h>
+#include <sys/inotify.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
 #include <sys/prctl.h>
-#include <sys/socket.h>
 #include <sys/signalfd.h>
-#include <sys/epoll.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
+#include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/inotify.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <unistd.h>
 
 #include "sd-daemon.h"
 #include "sd-event.h"
 
-#include "terminal-util.h"
-#include "signal-util.h"
-#include "event-util.h"
-#include "netlink-util.h"
 #include "cgroup-util.h"
-#include "process-util.h"
+#include "cpu-set-util.h"
 #include "dev-setup.h"
+#include "event-util.h"
+#include "fd-util.h"
 #include "fileio.h"
-#include "selinux-util.h"
-#include "udev.h"
-#include "udev-util.h"
 #include "formats-util.h"
 #include "hashmap.h"
+#include "io-util.h"
+#include "netlink-util.h"
+#include "parse-util.h"
+#include "process-util.h"
+#include "selinux-util.h"
+#include "signal-util.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "udev-util.h"
+#include "udev.h"
 
 static bool arg_debug = false;
 static int arg_daemonize = false;
@@ -1670,9 +1675,8 @@ int main(int argc, char *argv[]) {
 
                 arg_children_max = 8;
 
-                if (sched_getaffinity(0, sizeof (cpu_set), &cpu_set) == 0) {
+                if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == 0)
                         arg_children_max += CPU_COUNT(&cpu_set) * 2;
-                }
 
                 log_debug("set children_max to %u", arg_children_max);
         }
@@ -1706,7 +1710,7 @@ int main(int argc, char *argv[]) {
                    by PID1. otherwise we are not guaranteed to have a dedicated cgroup */
                 r = cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, 0, &cgroup);
                 if (r < 0) {
-                        if (r == -ENOENT)
+                        if (r == -ENOENT || r == -ENOEXEC)
                                 log_debug_errno(r, "did not find dedicated cgroup: %m");
                         else
                                 log_warning_errno(r, "failed to get cgroup: %m");