*/
/*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
*/
#include <sys/atomic.h>
mutex_enter(&pidlock);
p = prfind(probe->ftp_pid);
+ if (p == NULL) {
+ /*
+ * So it's not that the target process is being born,
+ * it's that it isn't there at all (and we simply
+ * happen to be forking). Anyway, we know that the
+ * target is definitely gone, so bail out.
+ */
+ mutex_exit(&pidlock);
+ return (0);
+ }
+
/*
* Confirm that curproc is indeed forking the process in which
* we're trying to enable probes.
*/
- ASSERT(p != NULL);
ASSERT(p->p_parent == curproc);
ASSERT(p->p_stat == SIDL);