]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: Use log_unit_error_errno() instead of log_error_errno()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 10 Mar 2023 11:25:42 +0000 (12:25 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 13 Mar 2023 11:33:11 +0000 (12:33 +0100)
src/core/execute.c

index 9db5b2cd17e612925fd781e0f8a24b8cecd4cb41..3800c7a38bf8951f185f81886f4465a83bb4eb6f 100644 (file)
@@ -4198,9 +4198,10 @@ static int get_open_file_fd(Unit *u, const OpenFile *of) {
 
         ofd = open(of->path, O_PATH | O_CLOEXEC);
         if (ofd < 0)
-                return log_error_errno(errno, "Could not open \"%s\": %m", of->path);
+                return log_unit_error_errno(u, errno, "Could not open \"%s\": %m", of->path);
+
         if (fstat(ofd, &st) < 0)
-                return log_error_errno(errno, "Failed to stat %s: %m", of->path);
+                return log_unit_error_errno(u, errno, "Failed to stat %s: %m", of->path);
 
         if (S_ISSOCK(st.st_mode)) {
                 fd = connect_unix_harder(u, of, ofd);
@@ -4208,7 +4209,8 @@ static int get_open_file_fd(Unit *u, const OpenFile *of) {
                         return fd;
 
                 if (FLAGS_SET(of->flags, OPENFILE_READ_ONLY) && shutdown(fd, SHUT_WR) < 0)
-                        return log_error_errno(errno, "Failed to shutdown send for socket %s: %m", of->path);
+                        return log_unit_error_errno(u, errno, "Failed to shutdown send for socket %s: %m",
+                                                    of->path);
 
                 log_unit_debug(u, "socket %s opened (fd=%d)", of->path, fd);
         } else {