From f69ae362475546d39bbac4730148b6637c62b742 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 27 Apr 2018 10:55:42 +0200 Subject: [SERVER] Proper exit code and message when shutting down due to error or signal --- src/server/server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/server.c b/src/server/server.c index e2314a2..71b791a 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -308,10 +308,14 @@ int main(int argc, char *argv[]) logadd( LOG_INFO, "Loading images...." ); // Load all images in base path if ( !image_loadAll( NULL ) || _shutdown ) { - logadd( LOG_ERROR, "Could not load images." ); + if ( _shutdown ) { + logadd( LOG_ERROR, "Received shutdown request while loading images." ); + } else { + logadd( LOG_ERROR, "Could not load images." ); + } free( bindAddress ); dnbd3_cleanup(); - return 0; + return _shutdown ? 0 : 1; } // Give other threads some time to start up before accepting connections -- cgit v1.2.3-55-g7522