diff options
author | Daniel Mack <github@zonque.org> | 2015-10-08 16:09:09 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-10-08 16:09:09 +0200 |
commit | ad86c1335a2a474f91186a736a5231d0c66313c6 (patch) | |
tree | f3cc983826f4067f8dcb12f4828a2e2c8cc8e64c /src/core/automount.c | |
parent | 8f3db94d9d905e6c31c1fcd0dcc6be7b78034c5c (diff) | |
parent | 1af1f2f92ef52e3e905b7928d42345d9c48e7e7b (diff) |
Merge pull request #1496 from poettering/stdin-fd
allow passing in fds for stdin/stdout/stderr for transient services
Diffstat (limited to 'src/core/automount.c')
-rw-r--r-- | src/core/automount.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index 8173a6cbe8..e0535ec201 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -774,8 +774,9 @@ static int automount_stop(Unit *u) { static int automount_serialize(Unit *u, FILE *f, FDSet *fds) { Automount *a = AUTOMOUNT(u); - void *p; Iterator i; + void *p; + int r; assert(a); assert(f); @@ -790,15 +791,9 @@ static int automount_serialize(Unit *u, FILE *f, FDSet *fds) { SET_FOREACH(p, a->expire_tokens, i) unit_serialize_item_format(u, f, "expire-token", "%u", PTR_TO_UINT(p)); - if (a->pipe_fd >= 0) { - int copy; - - copy = fdset_put_dup(fds, a->pipe_fd); - if (copy < 0) - return copy; - - unit_serialize_item_format(u, f, "pipe-fd", "%i", copy); - } + r = unit_serialize_item_fd(u, f, fds, "pipe-fd", a->pipe_fd); + if (r < 0) + return r; return 0; } |