diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-27 19:38:15 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-27 19:38:15 -0800 |
commit | 10f3ea0008a4563c2baa4f29954c285d2d53d7dc (patch) | |
tree | 8aedadea55a31de188be16a1ec140cdbc76adba5 /src/proc.cpp | |
parent | 88a785e32117081b91b813ac6b5437deb33ef0f7 (diff) |
Mark a bunch of constructors as explicit
This prevents undesired implicit conversions
Diffstat (limited to 'src/proc.cpp')
-rw-r--r-- | src/proc.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/proc.cpp b/src/proc.cpp index 0a0da0a8..e16688f0 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -354,8 +354,6 @@ int job_signal(job_t *j, int signal) /** Store the status of the process pid that was returned by waitpid. - Return 0 if all went well, nonzero otherwise. - This is called from a signal handler. */ static void mark_process_status(const job_t *j, process_t *p, int status) { @@ -374,18 +372,7 @@ static void mark_process_status(const job_t *j, process_t *p, int status) { /* This should never be reached */ p->completed = 1; - - char mess[MESS_SIZE]; - snprintf(mess, - MESS_SIZE, - "Process %ld exited abnormally\n", - (long) p->pid); - /* - If write fails, do nothing. We're in a signal handlers error - handler. If things aren't working properly, it's safer to - give up. - */ - write_ignore(2, mess, strlen(mess)); + fprintf(stderr, "Process %ld exited abnormally\n", (long)p->pid); } } @@ -399,10 +386,8 @@ void job_mark_process_as_failed(const job_t *job, process_t *p) } /** - Handle status update for child \c pid. This function is called by - the signal handler, so it mustn't use malloc or any such hitech - nonsense. - + Handle status update for child \c pid. + \param pid the pid of the process whose status changes \param status the status as returned by wait */ @@ -411,14 +396,6 @@ static void handle_child_status(pid_t pid, int status) bool found_proc = false; const job_t *j = NULL; process_t *p = NULL; -// char mess[MESS_SIZE]; - /* - snprintf( mess, - MESS_SIZE, - "Process %d\n", - (int) pid ); - write( 2, mess, strlen(mess )); - */ job_iterator_t jobs; while (! found_proc && (j = jobs.next())) |