HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

src/journal/journald-stream.c

35,895 bytesGit mode 100644Download original fileLGPL-2.1-or-later

Git blob: a058cd390bcb7a553321c83eeb237ac9751ea083

Lines 1001–1027 of 1,027

         * in again on next start */
 
        msghdr.msg_controllen = CMSG_SPACE(sizeof(int));
        msghdr.msg_control = alloca0(msghdr.msg_controllen);
 
        cmsg = CMSG_FIRSTHDR(&msghdr);
        cmsg->cmsg_level = SOL_SOCKET;
        cmsg->cmsg_type = SCM_RIGHTS;
        cmsg->cmsg_len = CMSG_LEN(sizeof(int));
 
        memcpy(CMSG_DATA(cmsg), &s->fd, sizeof(int));
 
        l = sendmsg(s->manager->notify_fd, &msghdr, MSG_DONTWAIT|MSG_NOSIGNAL);
        if (l < 0) {
                if (errno == EAGAIN)
                        return;
 
                log_error_errno(errno, "Failed to send stream file descriptor to service manager: %m");
        } else {
                log_debug("Successfully sent stream file descriptor to service manager.");
                s->fdstore = 1;
        }
 
        LIST_REMOVE(stdout_stream_notify_queue, s->manager->stdout_streams_notify_queue, s);
        s->in_notify_queue = false;
}