Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 907988 Details for
Bug 1078361
Implement dynamic token timeout and make it default
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Log: Make reload of logging work
tmp.Bfsq7khISc (text/plain), 2.58 KB, created by
Jan Friesse
on 2014-06-12 07:39:34 UTC
(
hide
)
Description:
Log: Make reload of logging work
Filename:
MIME Type:
Creator:
Jan Friesse
Created:
2014-06-12 07:39:34 UTC
Size:
2.58 KB
patch
obsolete
>From 1b6abcc7d5afd4651efcdba1a65effb259f6ee3e Mon Sep 17 00:00:00 2001 >From: Jan Friesse <jfriesse@redhat.com> >Date: Mon, 24 Mar 2014 17:36:45 +0100 >Subject: [PATCH] Log: Make reload of logging work > >When reload was called multiple times (~20), logging to file stopped >working. > >Main problem was hidden in the fact, that log file was opened multiple >times, because even target_id was shared via subsystem loggers, file >name was not. > >Solution is to ALWAYS set proper log file name into subsystem logger >(copy is stored). This will not only fix problem but also removes small >leak. > >Also if filename didn't changed, function can return sooner. > >Signed-off-by: Jan Friesse <jfriesse@redhat.com> >Reviewed-by: Christine Caulfield <ccaulfie@redhat.com> >--- > exec/logsys.c | 33 +++++++++++++++++++++++---------- > 1 files changed, 23 insertions(+), 10 deletions(-) > >diff --git a/exec/logsys.c b/exec/logsys.c >index 45f1b06..8270da7 100644 >--- a/exec/logsys.c >+++ b/exec/logsys.c >@@ -166,15 +166,37 @@ static int logsys_config_file_set_unlocked ( > return (0); > } > >+ if (logsys_loggers[subsysid].target_id > 0 && >+ logsys_loggers[subsysid].logfile != NULL && >+ strcmp(file, logsys_loggers[subsysid].logfile) == 0) { >+ return (0); >+ } >+ > if (strlen(file) >= PATH_MAX) { > snprintf (error_string_response, > sizeof(error_string_response), >- "%s: logfile name exceed maximum system filename lenght", >+ "%s: logfile name exceed maximum system filename length", > logsys_loggers[subsysid].subsys); > *error_string = error_string_response; > return (-1); > } > >+ if (logsys_loggers[subsysid].logfile != NULL) { >+ free(logsys_loggers[subsysid].logfile); >+ logsys_loggers[subsysid].logfile = NULL; >+ } >+ >+ logsys_loggers[subsysid].logfile = strdup(file); >+ >+ if (logsys_loggers[subsysid].logfile == NULL) { >+ snprintf (error_string_response, >+ sizeof(error_string_response), >+ "Unable to allocate memory for logfile '%s'", >+ file); >+ *error_string = error_string_response; >+ return (-1); >+ } >+ > for (i = 0; i <= LOGSYS_MAX_SUBSYS_COUNT; i++) { > if ((logsys_loggers[i].logfile != NULL) && > (strcmp (logsys_loggers[i].logfile, file) == 0) && >@@ -186,15 +208,6 @@ static int logsys_config_file_set_unlocked ( > return (0); > } > } >- logsys_loggers[subsysid].logfile = strdup(file); >- if (logsys_loggers[subsysid].logfile == NULL) { >- snprintf (error_string_response, >- sizeof(error_string_response), >- "Unable to allocate memory for logfile '%s'", >- file); >- *error_string = error_string_response; >- return (-1); >- } > > if (logsys_loggers[subsysid].target_id > 0) { > int num_using_current = 0; >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1078361
:
907987
| 907988 |
907989
|
907990
|
907991
|
907992
|
907993
|
946428
|
946429
|
946430