]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/socket: use log_unit_*()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Jan 2019 19:01:32 +0000 (04:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Jan 2019 19:11:45 +0000 (04:11 +0900)
src/core/socket.c

index dd126a7f21b7d06fe27f2ea3c9fde6452c63ef17..693b19f71ed0f8c55541b935a47b90cd140f8699 100644 (file)
@@ -561,7 +561,7 @@ int socket_acquire_peer(Socket *s, int fd, SocketPeer **p) {
 
         r = getpeername(fd, &sa.peer.sa, &salen);
         if (r < 0)
-                return log_error_errno(errno, "getpeername failed: %m");
+                return log_unit_error_errno(UNIT(s), errno, "getpeername failed: %m");
 
         if (!IN_SET(sa.peer.sa.sa_family, AF_INET, AF_INET6, AF_VSOCK)) {
                 *p = NULL;
@@ -1534,7 +1534,7 @@ static int socket_address_listen_in_cgroup(
 shortcut:
         fd = socket_address_listen_do(s, address, label);
         if (fd < 0)
-                return log_error_errno(fd, "Failed to create listening socket: %m");
+                return log_unit_error_errno(UNIT(s), fd, "Failed to create listening socket: %m");
 
         return fd;
 }
@@ -2521,14 +2521,14 @@ static int socket_serialize(Unit *u, FILE *f, FDSet *fds) {
 
                 copy = fdset_put_dup(fds, p->fd);
                 if (copy < 0)
-                        return log_warning_errno(copy, "Failed to serialize socket fd: %m");
+                        return log_unit_warning_errno(u, copy, "Failed to serialize socket fd: %m");
 
                 if (p->type == SOCKET_SOCKET) {
                         _cleanup_free_ char *t = NULL;
 
                         r = socket_address_print(&p->address, &t);
                         if (r < 0)
-                                return log_error_errno(r, "Failed to format socket address: %m");
+                                return log_unit_error_errno(u, r, "Failed to format socket address: %m");
 
                         if (socket_address_family(&p->address) == AF_NETLINK)
                                 (void) serialize_item_format(f, "netlink", "%i %s", copy, t);