X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fautomount.c;h=cec90cbb319d7d60bc2a7940e6eff630bb1b2f36;hb=a6dcc7e5924f9c27d3e9c6560a448b02ec28b65f;hp=9f6bd84b219920dcc193302860c78c5b1616594c;hpb=5ffa8c818120e35c89becd938d160235c069dd12;p=elogind.git diff --git a/src/core/automount.c b/src/core/automount.c index 9f6bd84b2..cec90cbb3 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -32,8 +32,6 @@ #include "unit.h" #include "automount.h" #include "mount.h" -#include "load-fragment.h" -#include "load-dropin.h" #include "unit-name.h" #include "special.h" #include "label.h" @@ -235,7 +233,7 @@ static void automount_set_state(Automount *a, AutomountState state) { unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state], true); } -static int automount_coldplug(Unit *u) { +static int automount_coldplug(Unit *u, Hashmap *deferred_work) { Automount *a = AUTOMOUNT(u); int r; @@ -727,7 +725,6 @@ static bool automount_check_gc(Unit *u) { static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, void *userdata) { union autofs_v5_packet_union packet; Automount *a = AUTOMOUNT(userdata); - ssize_t l; int r; assert(a); @@ -738,12 +735,9 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo goto fail; } - l = loop_read(a->pipe_fd, &packet, sizeof(packet), true); - if (l != sizeof(packet)) { - if (l < 0) - log_unit_error_errno(UNIT(a)->id, l, "Invalid read from pipe: %m"); - else - log_unit_error(UNIT(a)->id, "Invalid read from pipe: short read"); + r = loop_read_exact(a->pipe_fd, &packet, sizeof(packet), true); + if (r < 0) { + log_unit_error_errno(UNIT(a)->id, r, "Invalid read from pipe: %m"); goto fail; }