[systemd-devel] [PATCH] logs-show.c: Fix missing sys/socket.h include

Marcel Holtmann marcel at holtmann.org
Thu Dec 12 05:17:27 PST 2013


  CC       src/shared/logs-show.lo
src/shared/logs-show.c: In function 'get_boot_id_for_machine':
src/shared/logs-show.c:1153:9: warning: implicit declaration of function 'socketpair' [-Wimplicit-function-declaration]
         if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sock) < 0)
         ^
src/shared/logs-show.c:1153:24: error: 'AF_UNIX' undeclared (first use in this function)
         if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sock) < 0)
                        ^
src/shared/logs-show.c:1153:24: note: each undeclared identifier is reported only once for each function it appears in
src/shared/logs-show.c:1153:33: error: 'SOCK_DGRAM' undeclared (first use in this function)
         if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sock) < 0)
                                 ^
src/shared/logs-show.c:1179:17: warning: implicit declaration of function 'send' [-Wimplicit-function-declaration]
                 k = send(sock[1], buf, 36, MSG_NOSIGNAL);
                 ^
src/shared/logs-show.c:1179:44: error: 'MSG_NOSIGNAL' undeclared (first use in this function)
                 k = send(sock[1], buf, 36, MSG_NOSIGNAL);
                                            ^
src/shared/logs-show.c:1189:9: warning: implicit declaration of function 'recv' [-Wimplicit-function-declaration]
         k = recv(sock[0], buf, 36, 0);
         ^

---
 src/shared/logs-show.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index c99fc7569429..0e3fd3de2630 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <sys/poll.h>
+#include <sys/socket.h>
 #include <string.h>
 #include <fcntl.h>
 
-- 
1.8.3.1



More information about the systemd-devel mailing list