X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fautomount.c;h=51f7373f77d13e3e7b85b1a5cc8badb262ed7c93;hb=09667885bad3a8cb7f1a002766f9e59140775526;hp=f7954871318bf44ed6a963d9dd76f086e973c417;hpb=4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f;p=elogind.git diff --git a/src/core/automount.c b/src/core/automount.c index f79548713..51f7373f7 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -758,7 +758,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo get_process_comm(packet.v5_packet.pid, &p); log_unit_info(UNIT(a)->id, - "Got automount request for %s, triggered by "PID_FMT" (%s)", + "Got automount request for %s, triggered by %"PRIu32" (%s)", a->where, packet.v5_packet.pid, strna(p)); } else log_unit_debug(UNIT(a)->id, "Got direct mount request on %s", a->where); @@ -807,6 +807,17 @@ static void automount_reset_failed(Unit *u) { a->result = AUTOMOUNT_SUCCESS; } +static bool automount_supported(Manager *m) { + static int supported = -1; + + assert(m); + + if (supported < 0) + supported = access("/dev/autofs", F_OK) >= 0; + + return supported; +} + static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = { [AUTOMOUNT_DEAD] = "dead", [AUTOMOUNT_WAITING] = "waiting", @@ -859,6 +870,7 @@ const UnitVTable automount_vtable = { .bus_vtable = bus_automount_vtable, .shutdown = automount_shutdown, + .supported = automount_supported, .status_message_formats = { .finished_start_job = {