mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Handle EINTR when sending logs to the journal
Ray pointed out that we might well get interrupted here, and should not loose logs due to that.
This commit is contained in:
parent
34cb9c7de1
commit
ad285d9bd2
@ -1818,9 +1818,13 @@ journal_sendv (struct iovec *iov,
|
||||
mh.msg_iov = iov;
|
||||
mh.msg_iovlen = iovlen;
|
||||
|
||||
retry:
|
||||
if (sendmsg (journal_fd, &mh, MSG_NOSIGNAL) >= 0)
|
||||
return 0;
|
||||
|
||||
if (errno == EINTR)
|
||||
goto retry;
|
||||
|
||||
if (errno != EMSGSIZE && errno != ENOBUFS)
|
||||
return -1;
|
||||
|
||||
@ -1857,9 +1861,14 @@ journal_sendv (struct iovec *iov,
|
||||
|
||||
mh.msg_controllen = cmsg->cmsg_len;
|
||||
|
||||
(void) sendmsg (journal_fd, &mh, MSG_NOSIGNAL);
|
||||
|
||||
retry2:
|
||||
if (sendmsg (journal_fd, &mh, MSG_NOSIGNAL) >= 0)
|
||||
return 0;
|
||||
|
||||
if (errno == EINTR)
|
||||
goto retry2;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user