From: Michael Chase-S. <mc...@us...> - 2012-02-24 23:48:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 1fe218093ac8dbdc009a8cddfc35c3042642d87b (commit) via be8e5777460c7e6356d039c6477e588079de3d99 (commit) from 2aacc4b26f420a661cb7c606efdfb86c59280a95 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1fe218093ac8dbdc009a8cddfc35c3042642d87b Author: Michael Chase-Salerno <br...@li...> Date: Fri Feb 24 18:47:59 2012 -0500 [ 3488688 ] Don't spawn logger for clients commit be8e5777460c7e6356d039c6477e588079de3d99 Author: Michael Chase-Salerno <br...@li...> Date: Fri Feb 24 18:45:57 2012 -0500 3488688 Don't spawn logger for clients ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 29f8092..bf96565 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ * mlog.c: [ 3487675 ] Log message troubles with \n + * mlog.c, mlog.h, cimcClientSfcbLocal.c, sfcBroker.c, sfcbinst2mof.c: + [ 3488688 ] Don't spawn logger for clients + 2012-01-26 Michael Chase-Salerno <br...@li...> * interopProvider.c, indCIMXMLHandler.c, indRetryTest.sh diff --git a/cimcClientSfcbLocal.c b/cimcClientSfcbLocal.c index f92e579..b2081bc 100644 --- a/cimcClientSfcbLocal.c +++ b/cimcClientSfcbLocal.c @@ -2091,7 +2091,7 @@ _Create_SfcbLocal_Env(char *id) env->hdl = NULL; env->ft = &localFT; // enable logging when called from sfcc - startLogging(LOG_ERR); + startLogging(LOG_ERR,0); // enable trace logging _SFCB_TRACE_INIT(); diff --git a/mlog.c b/mlog.c index 3f12032..291af0d 100644 --- a/mlog.c +++ b/mlog.c @@ -31,6 +31,9 @@ const char *_mlog_id = #include "trace.h" /* for setSignal() */ #include <sys/wait.h> +// Macro to open the syslog +#define OPENLOG(level) openlog("sfcb", LOG_PID, LOG_DAEMON); setlogmask(LOG_UPTO(level)); + FILE *log_w_stream; int logfds[2] = { 0, 0 }; @@ -45,8 +48,7 @@ runLogger(int listenFd, int level) int priosysl; char buf[LOG_MSG_MAX]; - openlog("sfcb", LOG_PID, LOG_DAEMON); - setlogmask(LOG_UPTO(level)); + OPENLOG(level); stream = fdopen(listenFd, "r"); @@ -79,8 +81,15 @@ runLogger(int listenFd, int level) * sets up the logging pipe and forks off the logger process */ void -startLogging(int level) +startLogging(int level, int thread) { + // if we're a client, just open the log and + // don't start a logger. + if (! thread ) { + OPENLOG(level); + return; + } + pipe(logfds); int lpid; lpid = fork(); diff --git a/mlog.h b/mlog.h index e8441c5..15bce24 100644 --- a/mlog.h +++ b/mlog.h @@ -29,7 +29,7 @@ #define LOG_MSG_MAX 4096 -void startLogging(int level); +void startLogging(int level, int thread); void closeLogging(); void mlogf(int priority, int errout, const char *fmt, ...); diff --git a/sfcBroker.c b/sfcBroker.c index ea7ee59..b755fe5 100644 --- a/sfcBroker.c +++ b/sfcBroker.c @@ -641,7 +641,7 @@ main(int argc, char *argv[]) usage(1); } - startLogging(syslogLevel); + startLogging(syslogLevel,1); mlogf(M_INFO, M_SHOW, "--- %s V" sfcHttpDaemonVersion " started - %d\n", name, currentProc); diff --git a/sfcbinst2mof.c b/sfcbinst2mof.c index 4beae48..40ca488 100644 --- a/sfcbinst2mof.c +++ b/sfcbinst2mof.c @@ -1,6 +1,7 @@ #include <string.h> #include <stdio.h> #include <stdlib.h> +#include <syslog.h> #include "cmpi/cmpidt.h" #include "cmpi/cmpimacs.h" @@ -9,6 +10,7 @@ #include "objectImpl.h" #include "control.h" #include "array.h" +#include "mlog.h" #define VERSION "0.8.0" @@ -425,6 +427,8 @@ main(int argc, char *argv[]) help(argv[0]); return 0; } + + startLogging(LOG_INFO,0); // now let's get to work char *ns = namespace; char *clsname = classname; hooks/post-receive -- SFCB - Small Footprint CIM Broker |