summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-12-07 19:27:43 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-12-07 19:27:43 +0100
commite1c99bfd56ea23e1f18bc4c0a0a0a0ef2055e368 (patch)
treea718e94f656bffdaf751ef13f696e8793d8b055f /src
parent4b6c97b8de6d9dba605d7a4a01e06b15c2d5c252 (diff)
downloadbiruda-e1c99bfd56ea23e1f18bc4c0a0a0a0ef2055e368.tar.gz
biruda-e1c99bfd56ea23e1f18bc4c0a0a0a0ef2055e368.tar.bz2
proper error handling around worker process killing
Diffstat (limited to 'src')
-rw-r--r--src/worker.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/worker.c b/src/worker.c
index d2f0fef..abf8404 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -367,9 +367,15 @@ void worker_terminate( worker_t *worker )
}
#ifndef _WIN32
- (void)kill( wed->pid, SIGTERM );
+ if( kill( wed->pid, SIGTERM ) < 0 ) {
+ fprintf( stderr, "ERROR: worker %s (PID " PRIgid ") could not be killed: %s\n",
+ worker->name, wed->pid, strerror( errno ) );
+ }
#else
- (void)TerminateProcess( wed->pid, 0 );
+ if( !TerminateProcess( wed->pid, 0 ) ) {
+ fprintf( stderr, "ERROR: worker %s (PID " PRIgid ") could not be killed\n",
+ worker->name, wed->pid );
+ }
#endif
}