From 68c9381770090d89d59bdff9ec391c874488b5d4 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Sun, 24 Apr 2011 22:47:12 -0400 Subject: [PATCH] switch_core_file: Fix a regression from earlier commit on some distro forcing warning on 'forced' return function value --- src/switch_core_file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); }