]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/import/importd.c
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
[thirdparty/systemd.git] / src / import / importd.c
index ffff94ee721beafee1ed3b7c3121a7d0182d2e8c..975907e3c922d9f3efca32af6eff840fad0860ce 100644 (file)
 #include <sys/prctl.h>
 
 #include "sd-bus.h"
-#include "util.h"
-#include "strv.h"
-#include "bus-util.h"
+
 #include "bus-common-errors.h"
-#include "socket-util.h"
-#include "mkdir.h"
+#include "bus-util.h"
 #include "def.h"
-#include "missing.h"
+#include "fd-util.h"
+#include "hostname-util.h"
+#include "import-util.h"
 #include "machine-pool.h"
+#include "missing.h"
+#include "mkdir.h"
+#include "parse-util.h"
 #include "path-util.h"
-#include "import-util.h"
 #include "process-util.h"
 #include "signal-util.h"
-#include "hostname-util.h"
+#include "socket-util.h"
+#include "strv.h"
+#include "util.h"
 
 typedef struct Transfer Transfer;
 typedef struct Manager Manager;
@@ -167,6 +170,7 @@ static int transfer_new(Manager *m, Transfer **ret) {
         t->type = _TRANSFER_TYPE_INVALID;
         t->log_fd = -1;
         t->stdin_fd = -1;
+        t->stdout_fd = -1;
         t->verify = _IMPORT_VERIFY_INVALID;
 
         id = m->current_transfer_id + 1;
@@ -599,14 +603,11 @@ static int manager_on_notify(sd_event_source *s, int fd, uint32_t revents, void
 
         cmsg_close_all(&msghdr);
 
-        CMSG_FOREACH(cmsg, &msghdr) {
+        CMSG_FOREACH(cmsg, &msghdr)
                 if (cmsg->cmsg_level == SOL_SOCKET &&
-                           cmsg->cmsg_type == SCM_CREDENTIALS &&
-                           cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) {
-
+                    cmsg->cmsg_type == SCM_CREDENTIALS &&
+                    cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
                         ucred = (struct ucred*) CMSG_DATA(cmsg);
-                }
-        }
 
         if (msghdr.msg_flags & MSG_TRUNC) {
                 log_warning("Got overly long notification datagram, ignoring.");