diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-27 18:09:32 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-27 18:09:32 +0100 |
commit | dc1e811ebd80d1659d1476c4ae733d212d6aa946 (patch) | |
tree | ee28d0fef1577fdc73e723717a83db225406ce8b /src/core/mount.c | |
parent | 64529a2921a8972878b3f953935f286ce77914e0 (diff) | |
parent | 930d2838f206d725d890c78475312910cd16329a (diff) |
Merge pull request #1698 from poettering/pid-is-unwaited-fix
fixup for previous pr
Diffstat (limited to 'src/core/mount.c')
-rw-r--r-- | src/core/mount.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/core/mount.c b/src/core/mount.c index 2761f632bd..950d5d76d5 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -632,19 +632,19 @@ static int mount_coldplug(Unit *u) { if (new_state == m->state) return 0; - if (new_state == MOUNT_MOUNTING || - new_state == MOUNT_MOUNTING_DONE || - new_state == MOUNT_REMOUNTING || - new_state == MOUNT_UNMOUNTING || - new_state == MOUNT_MOUNTING_SIGTERM || - new_state == MOUNT_MOUNTING_SIGKILL || - new_state == MOUNT_UNMOUNTING_SIGTERM || - new_state == MOUNT_UNMOUNTING_SIGKILL || - new_state == MOUNT_REMOUNTING_SIGTERM || - new_state == MOUNT_REMOUNTING_SIGKILL) { - - if (m->control_pid <= 0) - return -EBADMSG; + if (m->control_pid > 0 && + pid_is_unwaited(m->control_pid) && + IN_SET(new_state, + MOUNT_MOUNTING, + MOUNT_MOUNTING_DONE, + MOUNT_REMOUNTING, + MOUNT_UNMOUNTING, + MOUNT_MOUNTING_SIGTERM, + MOUNT_MOUNTING_SIGKILL, + MOUNT_UNMOUNTING_SIGTERM, + MOUNT_UNMOUNTING_SIGKILL, + MOUNT_REMOUNTING_SIGTERM, + MOUNT_REMOUNTING_SIGKILL)) { r = unit_watch_pid(UNIT(m), m->control_pid); if (r < 0) |