From: Marc Olivier Chouinard Date: Mon, 25 Apr 2011 02:47:12 +0000 (-0400) Subject: switch_core_file: Fix a regression from earlier commit on some distro forcing warning... X-Git-Tag: v1.2-rc1~118^2~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68c9381770090d89d59bdff9ec391c874488b5d4;p=thirdparty%2Ffreeswitch.git switch_core_file: Fix a regression from earlier commit on some distro forcing warning on 'forced' return function value --- diff --git a/src/switch_core_file.c b/src/switch_core_file.c index 2186555386..a3f7cc12cc 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -571,8 +571,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh) #else command = switch_mprintf("/bin/mv %s %s", fh->spool_path, fh->file_path); #endif - system(command); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Copy spooled file [%s] to [%s]\n", fh->spool_path, fh->file_path); + if (system(command) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to copy spooled file [%s] to [%s] because of a command error : %s\n", fh->spool_path, fh->file_path, command); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Copy spooled file [%s] to [%s]\n", fh->spool_path, fh->file_path); + } free(command); }