summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwanYeong Kim <gy741.kim@gmail.com>2021-06-19 20:31:00 +0900
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-07-19 08:46:33 +0900
commit494ebe97026810bc6fc6f15cc014fa39c846ec48 (patch)
tree23f8344be7a16cd0b5e6eed78e6543b95ddaaec5
parent1fb7e753c0a852e71080689105f133e675ced4d9 (diff)
downloadDLT-daemon-494ebe97026810bc6fc6f15cc014fa39c846ec48.tar.gz
dlt-sortbytimestamp: Remove duplicated conditional statements code
This commit removes duplicate conditional statements. Signed-off-by: GwanYeong Kim <gy741.kim@gmail.com>
-rw-r--r--src/console/dlt-sortbytimestamp.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/console/dlt-sortbytimestamp.c b/src/console/dlt-sortbytimestamp.c
index 9419f75..5b99318 100644
--- a/src/console/dlt-sortbytimestamp.c
+++ b/src/console/dlt-sortbytimestamp.c
@@ -378,11 +378,8 @@ int main(int argc, char *argv[]) {
if ((begin < 0) || (end < 0) || (begin > end) ||
(begin >= file.counter) || (end >= file.counter)) {
fprintf(stderr, "ERROR: Selected message [begin-end]-[%d-%d] is out of range!\n", begin, end);
-
dlt_file_free(&file, vflag);
- if (ovalue)
- close(ohandle);
-
+ close(ohandle);
return -1;
}
@@ -396,11 +393,8 @@ int main(int argc, char *argv[]) {
if (timestamp_index == NULL) {
fprintf(stderr, "ERROR: Failed to allocate memory for message index!\n");
-
dlt_file_free(&file, vflag);
- if (ovalue)
- close(ohandle);
-
+ close(ohandle);
return -1;
}
@@ -437,11 +431,8 @@ int main(int argc, char *argv[]) {
if (temp_timestamp_index == NULL) {
fprintf(stderr, "ERROR: Failed to allocate memory for array\n");
-
dlt_file_free(&file, vflag);
- if (ovalue)
- close(ohandle);
-
+ close(ohandle);
return -1;
}
@@ -472,9 +463,7 @@ int main(int argc, char *argv[]) {
write_messages(ohandle, &file, timestamp_index, count);
}
- if (ovalue)
- close(ohandle);
-
+ close(ohandle);
verbose(1, "Tidying up.\n");
free(timestamp_index);
timestamp_index = NULL;