Revision: 23340 http://trac.macosforge.org/projects/launchd/changeset/23340 Author: zarzycki@apple.com Date: 2007-08-16 15:07:50 -0700 (Thu, 16 Aug 2007) Log Message: ----------- <rdar://problem/5415523> Server9A525(Install): Server doesn't bring Server Assistant after installation completed. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2007-08-14 21:14:14 UTC (rev 23339) +++ trunk/launchd/src/launchd_core_logic.c 2007-08-16 22:07:50 UTC (rev 23340) @@ -3035,6 +3035,7 @@ semaphoreitem_watch(job_t j, struct semaphoreitem *si) { char parentdir_path[PATH_MAX], *which_path = si->what; + int saved_errno = 0; int fflags = 0; strlcpy(parentdir_path, dirname(si->what), sizeof(parentdir_path)); @@ -3054,6 +3055,7 @@ return; } + /* See 5321044 for why we do the do-while loop and 5415523 for why ENOENT is checked */ do { if (si->fd == -1) { if ((si->fd = _fd(open(which_path, O_EVTONLY|O_NOCTTY))) == -1) { @@ -3069,6 +3071,7 @@ job_log(j, LOG_DEBUG, "Watching Vnode: %d", si->fd); if (kevent_mod(si->fd, EVFILT_VNODE, EV_ADD, fflags, 0, j) == -1) { + saved_errno = errno; /* * The FD can be revoked between the open() and kevent(). * This is similar to the inability for kevents to be @@ -3078,7 +3081,7 @@ job_assumes(j, runtime_close(si->fd) == 0); si->fd = -1; } - } while (si->fd == -1); + } while ((si->fd == -1) && (saved_errno == ENOENT)); } void