}
proc = _ENDPOINT_P(rp->r_proc_nr_e);
rproc_ptr[proc] = NULL;
+ return(OK);
}
- return(OK);
+
+ /* Late reply - send a reply when process dies. */
+ rp->r_flags |= RS_LATEREPLY;
+ rp->r_caller = m_ptr->m_source;
+ return EDONTREPLY;
}
}
#if VERBOSE
rp->r_pid= -1;
if ((rp->r_flags & RS_EXITING) || shutting_down) {
- rp->r_flags = 0; /* release slot */
+ /* No reply sent to RS_DOWN yet. */
+ if(rp->r_flags & RS_LATEREPLY) {
+ message rsm;
+ rsm.m_type = OK;
+ send(rp->r_caller, &rsm);
+ }
+
+ /* Release slot. */
+ rp->r_flags = 0;
if (rp->r_exec)
{
free(rp->r_exec);
rp->r_exec= NULL;
}
rproc_ptr[proc] = NULL;
+
}
else if(rp->r_flags & RS_REFRESHING) {
rp->r_restarts = -1; /* reset counter */
clock_t r_check_tm; /* timestamp of last check */
clock_t r_alive_tm; /* timestamp of last heartbeat */
clock_t r_stop_tm; /* timestamp of SIGTERM signal */
+ endpoint_t r_caller; /* RS_LATEREPLY caller */
char *r_exec; /* Executable image */
size_t r_exec_len; /* Length of image */
#define RS_NOPINGREPLY 0x010 /* driver failed to reply to a ping request */
#define RS_KILLED 0x020 /* driver is killed */
#define RS_CRASHED 0x040 /* driver crashed */
+#define RS_LATEREPLY 0x080 /* no reply sent to RS_DOWN caller yet */
/* Constants determining RS period and binary exponential backoff. */
#define RS_DELTA_T 60 /* check every T ticks */