chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert f_type fixups
[elogind.git]
/
src
/
journal
/
journald-stream.c
diff --git
a/src/journal/journald-stream.c
b/src/journal/journald-stream.c
index 98fdf781bff9a05596d8d17a7d528b8492d7eb70..6d51c29083505ef0c0486972b2a04faaee7eef3d 100644
(file)
--- a/
src/journal/journald-stream.c
+++ b/
src/journal/journald-stream.c
@@
-21,6
+21,7
@@
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stddef.h>
#include <sys/epoll.h>
#ifdef HAVE_SELINUX
#include <sys/epoll.h>
#ifdef HAVE_SELINUX
@@
-28,10
+29,11
@@
#endif
#include "socket-util.h"
#endif
#include "socket-util.h"
-#include "journald.h"
+#include "journald
-server
.h"
#include "journald-stream.h"
#include "journald-syslog.h"
#include "journald-kmsg.h"
#include "journald-stream.h"
#include "journald-syslog.h"
#include "journald-kmsg.h"
+#include "journald-console.h"
#define STDOUT_STREAMS_MAX 4096
#define STDOUT_STREAMS_MAX 4096
@@
-173,7
+175,7
@@
static int stdout_stream_line(StdoutStream *s, char *p) {
case STDOUT_STREAM_PRIORITY:
r = safe_atoi(p, &s->priority);
case STDOUT_STREAM_PRIORITY:
r = safe_atoi(p, &s->priority);
- if (r < 0 || s->priority <
= 0 || s->priority >=
999) {
+ if (r < 0 || s->priority <
0 || s->priority >
999) {
log_warning("Failed to parse log priority line.");
return -EINVAL;
}
log_warning("Failed to parse log priority line.");
return -EINVAL;
}
@@
-410,13
+412,16
@@
fail:
}
int server_open_stdout_socket(Server *s) {
}
int server_open_stdout_socket(Server *s) {
- union sockaddr_union sa;
int r;
struct epoll_event ev;
assert(s);
if (s->stdout_fd < 0) {
int r;
struct epoll_event ev;
assert(s);
if (s->stdout_fd < 0) {
+ union sockaddr_union sa = {
+ .un.sun_family = AF_UNIX,
+ .un.sun_path = "/run/systemd/journal/stdout",
+ };
s->stdout_fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (s->stdout_fd < 0) {
s->stdout_fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (s->stdout_fd < 0) {
@@
-424,10
+429,6
@@
int server_open_stdout_socket(Server *s) {
return -errno;
}
return -errno;
}
- zero(sa);
- sa.un.sun_family = AF_UNIX;
- strncpy(sa.un.sun_path, "/run/systemd/journal/stdout", sizeof(sa.un.sun_path));
-
unlink(sa.un.sun_path);
r = bind(s->stdout_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
unlink(sa.un.sun_path);
r = bind(s->stdout_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));