static void automount_enter_waiting(Automount *a) {
_cleanup_close_ int ioctl_fd = -EBADF;
- int p[2] = { -1, -1 };
+ int pipe_fd[2] = { -EBADF, -EBADF };
char name[STRLEN("systemd-") + DECIMAL_STR_MAX(pid_t) + 1];
_cleanup_free_ char *options = NULL;
bool mounted = false;
goto fail;
}
- if (pipe2(p, O_CLOEXEC) < 0) {
+ if (pipe2(pipe_fd, O_CLOEXEC) < 0) {
r = -errno;
goto fail;
}
- r = fd_nonblock(p[0], true);
+ r = fd_nonblock(pipe_fd[0], true);
if (r < 0)
goto fail;
if (asprintf(
&options,
"fd=%i,pgrp="PID_FMT",minproto=5,maxproto=5,direct%s%s",
- p[1],
+ pipe_fd[1],
getpgrp(),
isempty(a->extra_options) ? "" : ",",
strempty(a->extra_options)) < 0) {
mounted = true;
- p[1] = safe_close(p[1]);
+ pipe_fd[1] = safe_close(pipe_fd[1]);
if (stat(a->where, &st) < 0) {
r = -errno;
if (r < 0)
goto fail;
- r = sd_event_add_io(UNIT(a)->manager->event, &a->pipe_event_source, p[0], EPOLLIN, automount_dispatch_io, a);
+ r = sd_event_add_io(UNIT(a)->manager->event, &a->pipe_event_source, pipe_fd[0], EPOLLIN, automount_dispatch_io, a);
if (r < 0)
goto fail;
(void) sd_event_source_set_description(a->pipe_event_source, "automount-io");
- a->pipe_fd = p[0];
+ a->pipe_fd = pipe_fd[0];
a->dev_id = st.st_dev;
automount_set_state(a, AUTOMOUNT_WAITING);
fail:
log_unit_error_errno(UNIT(a), r, "Failed to initialize automounter: %m");
- safe_close_pair(p);
+ safe_close_pair(pipe_fd);
if (mounted) {
r = repeat_unmount(a->where, MNT_DETACH|UMOUNT_NOFOLLOW);