From 05a7914b8ee5efb159900df9965441c591406292 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 26 Feb 2020 01:18:45 +0400 Subject: [PATCH] [mod_json_cdr] scan-build: Fix dead assignments. --- src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c index a6eddc9f8e..fc4794a482 100644 --- a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c +++ b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c @@ -219,7 +219,7 @@ static void backup_cdr(cdr_data_t *data) } while (!(x<0) && json_len > (wrote += x)); if (!(x<0)) do { x = write(fd, "\n", 1); } while (!(x<0) && x<1); - close(fd); fd = -1; + close(fd); if (x < 0) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(data->uuid), SWITCH_LOG_ERROR, "Error writing [%s]\n",path); if (0 > unlink(path)) @@ -285,7 +285,7 @@ static void process_cdr(cdr_data_t *data) } while (!(x<0) && json_len > (wrote += x)); if (!(x<0)) do { x = write(fd, "\n", 1); } while (!(x<0) && x<1); - close(fd); fd = -1; + close(fd); if (x < 0) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(data->uuid), SWITCH_LOG_ERROR, "Error writing [%s]\n",path); if (0 > unlink(path)) -- 2.47.2