summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 04dcf4b427..8ddd7362a3 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -7338,7 +7338,7 @@ int exec_shared_runtime_deserialize_compat(Unit *u, const char *key, const char
} else if (streq(key, "netns-socket-0")) {
int fd;
- if (safe_atoi(value, &fd) < 0 || !fdset_contains(fds, fd)) {
+ if ((fd = parse_fd(value)) < 0 || !fdset_contains(fds, fd)) {
log_unit_debug(u, "Failed to parse netns socket value: %s", value);
return 0;
}
@@ -7349,7 +7349,7 @@ int exec_shared_runtime_deserialize_compat(Unit *u, const char *key, const char
} else if (streq(key, "netns-socket-1")) {
int fd;
- if (safe_atoi(value, &fd) < 0 || !fdset_contains(fds, fd)) {
+ if ((fd = parse_fd(value)) < 0 || !fdset_contains(fds, fd)) {
log_unit_debug(u, "Failed to parse netns socket value: %s", value);
return 0;
}
@@ -7422,9 +7422,9 @@ int exec_shared_runtime_deserialize_one(Manager *m, const char *value, FDSet *fd
n = strcspn(v, " ");
buf = strndupa_safe(v, n);
- r = safe_atoi(buf, &netns_fdpair[0]);
- if (r < 0)
- return log_debug_errno(r, "Unable to parse exec-runtime specification netns-socket-0=%s: %m", buf);
+ netns_fdpair[0] = parse_fd(buf);
+ if (netns_fdpair[0] < 0)
+ return log_debug_errno(netns_fdpair[0], "Unable to parse exec-runtime specification netns-socket-0=%s: %m", buf);
if (!fdset_contains(fds, netns_fdpair[0]))
return log_debug_errno(SYNTHETIC_ERRNO(EBADF),
"exec-runtime specification netns-socket-0= refers to unknown fd %d: %m", netns_fdpair[0]);
@@ -7441,9 +7441,9 @@ int exec_shared_runtime_deserialize_one(Manager *m, const char *value, FDSet *fd
n = strcspn(v, " ");
buf = strndupa_safe(v, n);
- r = safe_atoi(buf, &netns_fdpair[1]);
- if (r < 0)
- return log_debug_errno(r, "Unable to parse exec-runtime specification netns-socket-1=%s: %m", buf);
+ netns_fdpair[1] = parse_fd(buf);
+ if (netns_fdpair[1] < 0)
+ return log_debug_errno(netns_fdpair[1], "Unable to parse exec-runtime specification netns-socket-1=%s: %m", buf);
if (!fdset_contains(fds, netns_fdpair[1]))
return log_debug_errno(SYNTHETIC_ERRNO(EBADF),
"exec-runtime specification netns-socket-1= refers to unknown fd %d: %m", netns_fdpair[1]);
@@ -7460,9 +7460,9 @@ int exec_shared_runtime_deserialize_one(Manager *m, const char *value, FDSet *fd
n = strcspn(v, " ");
buf = strndupa_safe(v, n);
- r = safe_atoi(buf, &ipcns_fdpair[0]);
- if (r < 0)
- return log_debug_errno(r, "Unable to parse exec-runtime specification ipcns-socket-0=%s: %m", buf);
+ ipcns_fdpair[0] = parse_fd(buf);
+ if (ipcns_fdpair[0] < 0)
+ return log_debug_errno(ipcns_fdpair[0], "Unable to parse exec-runtime specification ipcns-socket-0=%s: %m", buf);
if (!fdset_contains(fds, ipcns_fdpair[0]))
return log_debug_errno(SYNTHETIC_ERRNO(EBADF),
"exec-runtime specification ipcns-socket-0= refers to unknown fd %d: %m", ipcns_fdpair[0]);
@@ -7479,9 +7479,9 @@ int exec_shared_runtime_deserialize_one(Manager *m, const char *value, FDSet *fd
n = strcspn(v, " ");
buf = strndupa_safe(v, n);
- r = safe_atoi(buf, &ipcns_fdpair[1]);
- if (r < 0)
- return log_debug_errno(r, "Unable to parse exec-runtime specification ipcns-socket-1=%s: %m", buf);
+ ipcns_fdpair[1] = parse_fd(buf);
+ if (ipcns_fdpair[1] < 0)
+ return log_debug_errno(ipcns_fdpair[1], "Unable to parse exec-runtime specification ipcns-socket-1=%s: %m", buf);
if (!fdset_contains(fds, ipcns_fdpair[1]))
return log_debug_errno(SYNTHETIC_ERRNO(EBADF),
"exec-runtime specification ipcns-socket-1= refers to unknown fd %d: %m", ipcns_fdpair[1]);