chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Fix udev gcc-2.95.4 compat
[elogind.git]
/
logging.c
diff --git
a/logging.c
b/logging.c
index e074b1562cc2b33f12ea07640d8a08cc9b3048d6..4815f39fdc377d261b92b212a4122398b4b1b780 100644
(file)
--- a/
logging.c
+++ b/
logging.c
@@
-21,31
+21,37
@@
*/
#include <stdarg.h>
*/
#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <syslog.h>
#include "udev.h"
#ifdef DEBUG
static int logging_init = 0;
#include <syslog.h>
#include "udev.h"
#ifdef DEBUG
static int logging_init = 0;
+static unsigned char udev_logname[42];
-static void init_logging
(void)
+static void init_logging(void)
{
{
- openlog ("udev", 0, LOG_DAEMON);
+ snprintf(udev_logname, 42,"udev[%d]", getpid());
+
+ openlog(udev_logname, 0, LOG_DAEMON);
logging_init = 1;
}
/**
* log_message - sends a message to the logging facility
*/
logging_init = 1;
}
/**
* log_message - sends a message to the logging facility
*/
-int log_message
(int level, const char *format, ...)
+int log_message(int level, const char *format, ...)
{
va_list args;
if (!logging_init)
init_logging();
{
va_list args;
if (!logging_init)
init_logging();
- va_start
(args, format);
- vsyslog
(level, format, args);
- va_end
(args);
+ va_start(args, format);
+ vsyslog(level, format, args);
+ va_end(args);
return 1;
}
return 1;
}