pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/41970?usp=email )

Change subject: logging_file: Avoid reopening file for stderr
......................................................................

logging_file: Avoid reopening file for stderr

target->tgt_file.fname is NULL for stderr log target.

Change-Id: I4a551b0c434c480e78852a0a4873700eac2f5853
---
M src/core/logging_file.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved




diff --git a/src/core/logging_file.c b/src/core/logging_file.c
index a9a1cb7..6e01c26 100644
--- a/src/core/logging_file.c
+++ b/src/core/logging_file.c
@@ -55,6 +55,9 @@
        OSMO_ASSERT(target->type == LOG_TGT_TYPE_FILE || target->type == 
LOG_TGT_TYPE_STDERR);
        OSMO_ASSERT(target->tgt_file.out || target->tgt_file.wqueue);

+       if (target->type == LOG_TGT_TYPE_STDERR)
+               return -ENOTSUP;
+
        if (target->tgt_file.out) {
                fclose(target->tgt_file.out);
                target->tgt_file.out = fopen(target->tgt_file.fname, "a");

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41970?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4a551b0c434c480e78852a0a4873700eac2f5853
Gerrit-Change-Number: 41970
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to