static void busname_unwatch_fd(BusName *n) { int r; assert(n); if (!n->starter_event_source) return; r = sd_event_source_set_enabled(n->starter_event_source, SD_EVENT_OFF); if (r < 0) log_unit_debug_errno(UNIT(n), r, "Failed to disable event source: %m"); }
static int automount_send_ready(Automount *a, Set *tokens, int status) { _cleanup_close_ int ioctl_fd = -1; unsigned token; int r; assert(a); assert(status <= 0); if (set_isempty(tokens)) return 0; ioctl_fd = open_ioctl_fd(UNIT(a)->manager->dev_autofs_fd, a->where, a->dev_id); if (ioctl_fd < 0) return ioctl_fd; if (status != 0) log_unit_debug_errno(UNIT(a), status, "Sending failure: %m"); else log_unit_debug(UNIT(a), "Sending success."); r = 0; /* Autofs thankfully does not hand out 0 as a token */ while ((token = PTR_TO_UINT(set_steal_first(tokens)))) { int k; /* Autofs fun fact II: * * if you pass a positive status code here, the kernel will * freeze! Yay! */ k = autofs_send_ready(UNIT(a)->manager->dev_autofs_fd, ioctl_fd, token, status); if (k < 0) r = k; } return r; }