chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6357ac6
)
log: make socket address structs static const
author
Lennart Poettering
<lennart@poettering.net>
Fri, 28 Nov 2014 01:56:39 +0000
(
02:56
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 28 Nov 2014 02:16:56 +0000
(
03:16
+0100)
src/shared/log.c
patch
|
blob
|
history
diff --git
a/src/shared/log.c
b/src/shared/log.c
index eba5853ab0a53ed9ad587b2a5f7c2339472b8eb1..e0dc026a6adc7bbfaab111656ef3a0b1a50895cc 100644
(file)
--- a/
src/shared/log.c
+++ b/
src/shared/log.c
@@
-106,8
+106,8
@@
void log_close_syslog(void) {
}
static int create_log_socket(int type) {
}
static int create_log_socket(int type) {
- int fd;
struct timeval tv;
struct timeval tv;
+ int fd;
fd = socket(AF_UNIX, type|SOCK_CLOEXEC, 0);
if (fd < 0)
fd = socket(AF_UNIX, type|SOCK_CLOEXEC, 0);
if (fd < 0)
@@
-128,12
+128,14
@@
static int create_log_socket(int type) {
}
static int log_open_syslog(void) {
}
static int log_open_syslog(void) {
- int r;
- union sockaddr_union sa = {
+
+
static const
union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/dev/log",
};
.un.sun_family = AF_UNIX,
.un.sun_path = "/dev/log",
};
+ int r;
+
if (syslog_fd >= 0)
return 0;
if (syslog_fd >= 0)
return 0;
@@
-176,10
+178,12
@@
void log_close_journal(void) {
}
static int log_open_journal(void) {
}
static int log_open_journal(void) {
- union sockaddr_union sa = {
+
+ static const union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/journal/socket",
};
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/journal/socket",
};
+
int r;
if (journal_fd >= 0)
int r;
if (journal_fd >= 0)
@@
-303,7
+307,7
@@
void log_set_facility(int facility) {
static int write_to_console(
int level,
int error,
static int write_to_console(
int level,
int error,
- const char*file,
+ const char
*file,
int line,
const char *func,
const char *object_field,
int line,
const char *func,
const char *object_field,
@@
-359,7
+363,7
@@
static int write_to_console(
static int write_to_syslog(
int level,
int error,
static int write_to_syslog(
int level,
int error,
- const char*file,
+ const char
*file,
int line,
const char *func,
const char *object_field,
int line,
const char *func,
const char *object_field,
@@
-529,7
+533,7
@@
static int write_to_journal(
static int log_dispatch(
int level,
int error,
static int log_dispatch(
int level,
int error,
- const char*file,
+ const char
*file,
int line,
const char *func,
const char *object_field,
int line,
const char *func,
const char *object_field,