From 405854e1e70a22d042cd0e544d1460055b65d57a Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 4 Jan 2016 22:48:58 -0500 Subject: Cleanups. --- other/bootstrap_daemon/src/tox-bootstrapd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'other/bootstrap_daemon/src/tox-bootstrapd.c') diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index e252a37d..27a910f3 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c @@ -127,6 +127,7 @@ void daemonize(LOG_BACKEND log_backend, char *pid_file_path) // Open the PID file for writing pid_file = fopen(pid_file_path, "a+"); + if (pid_file == NULL) { write_log(LOG_LEVEL_ERROR, "Couldn't open the PID file for writing: %s. Exiting.\n", pid_file_path); exit(1); @@ -209,7 +210,8 @@ int main(int argc, char *argv[]) } if (port < MIN_ALLOWED_PORT || port > MAX_ALLOWED_PORT) { - write_log(LOG_LEVEL_ERROR, "Invalid port: %d, should be in [%d, %d]. Exiting.\n", port, MIN_ALLOWED_PORT, MAX_ALLOWED_PORT); + write_log(LOG_LEVEL_ERROR, "Invalid port: %d, should be in [%d, %d]. Exiting.\n", port, MIN_ALLOWED_PORT, + MAX_ALLOWED_PORT); return 1; } -- cgit v1.2.3