]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal-remote/journal-remote.c
tree-wide: use -EBADF for fd initialization
[thirdparty/systemd.git] / src / journal-remote / journal-remote.c
index d1f394b027ab30e1a6e9f479f4f972a6f9a85ae2..a670468884133d3d2db09c119c51d512954c9f11 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "af-list.h"
 #include "alloc-util.h"
-#include "def.h"
+#include "constants.h"
 #include "errno-util.h"
 #include "escape.h"
 #include "fd-util.h"
@@ -104,7 +104,7 @@ int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer
         const void *key;
         int r;
 
-        switch(s->split_mode) {
+        switch (s->split_mode) {
         case JOURNAL_WRITE_SPLIT_NONE:
                 key = "one and only";
                 break;
@@ -294,7 +294,7 @@ int journal_remote_add_raw_socket(RemoteServer *s, int fd) {
         if (r < 0)
                 return r;
 
-        fd_ = -1;
+        fd_ = -EBADF;
         s->active++;
         return 0;
 }
@@ -483,7 +483,7 @@ static int accept_connection(
                 SocketAddress *addr,
                 char **hostname) {
 
-        _cleanup_close_ int fd2 = -1;
+        _cleanup_close_ int fd2 = -EBADF;
         int r;
 
         log_debug("Accepting new %s connection on fd:%d", type, fd);
@@ -495,7 +495,7 @@ static int accept_connection(
                 return log_error_errno(errno, "accept() on fd:%d failed: %m", fd);
         }
 
-        switch(socket_address_family(addr)) {
+        switch (socket_address_family(addr)) {
         case AF_INET:
         case AF_INET6: {
                 _cleanup_free_ char *a = NULL;