chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
generators: rework mount generators
[elogind.git]
/
src
/
journal
/
journald-stream.c
diff --git
a/src/journal/journald-stream.c
b/src/journal/journald-stream.c
index aba9054b2712482a52b3c8c6b38dbd920640a039..36fc755260f585f13ea29e9956d4ef06bedc2fa4 100644
(file)
--- a/
src/journal/journald-stream.c
+++ b/
src/journal/journald-stream.c
@@
-354,7
+354,6
@@
static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revent
Server *s = userdata;
StdoutStream *stream;
int fd, r;
Server *s = userdata;
StdoutStream *stream;
int fd, r;
- socklen_t len;
assert(s);
assert(s);
@@
-386,8
+385,8
@@
static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revent
stream->fd = fd;
stream->fd = fd;
-
len = sizeof(
stream->ucred);
- if (
getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &stream->ucred, &len)
< 0) {
+
r = getpeercred(fd, &
stream->ucred);
+ if (
r
< 0) {
log_error("Failed to determine peer credentials: %m");
goto fail;
}
log_error("Failed to determine peer credentials: %m");
goto fail;
}
@@
-404,7
+403,7
@@
static int stdout_stream_new(sd_event_source *es, int listen_fd, uint32_t revent
goto fail;
}
goto fail;
}
- r = sd_event_add_io(s->event,
fd, EPOLLIN, stdout_stream_process, stream, &stream->event_source
);
+ r = sd_event_add_io(s->event,
&stream->event_source, fd, EPOLLIN, stdout_stream_process, stream
);
if (r < 0) {
log_error("Failed to add stream to event loop: %s", strerror(-r));
goto fail;
if (r < 0) {
log_error("Failed to add stream to event loop: %s", strerror(-r));
goto fail;
@@
-461,7
+460,7
@@
int server_open_stdout_socket(Server *s) {
} else
fd_nonblock(s->stdout_fd, 1);
} else
fd_nonblock(s->stdout_fd, 1);
- r = sd_event_add_io(s->event,
s->stdout_fd, EPOLLIN, stdout_stream_new, s, &s->stdout_event_source
);
+ r = sd_event_add_io(s->event,
&s->stdout_event_source, s->stdout_fd, EPOLLIN, stdout_stream_new, s
);
if (r < 0) {
log_error("Failed to add stdout server fd to event source: %s", strerror(-r));
return r;
if (r < 0) {
log_error("Failed to add stdout server fd to event source: %s", strerror(-r));
return r;