summaryrefslogtreecommitdiffstats
path: root/cmd/zed
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2017-04-08 13:14:14 -0400
committerBrian Behlendorf <[email protected]>2017-04-12 08:57:25 -0700
commitbc482ac2ed80d77cf0186ccf670e02545f4ba883 (patch)
tree9274de8a6c870ddcf3a651517ec2b86473f81823 /cmd/zed
parentdd49132a1d727c7363bbad82f390c06c40d140c6 (diff)
Add missing includes to zed_log.c
GCC 4.9.4 complains about implicit function declarations when building against musl on Gentoo. zed_log.c: In function ‘zed_log_pipe_open’: zed_log.c:69:7: warning: implicit declaration of function ‘getpid’ (int)getpid()); ^ zed_log.c:71:2: warning: implicit declaration of function ‘pipe’ if (pipe(_ctx.pipe_fd) < 0) ^ zed_log.c: In function ‘zed_log_pipe_close_reads’: zed_log.c:90:2: warning: implicit declaration of function ‘close’ if (close(_ctx.pipe_fd[0]) < 0) ^ zed_log.c: In function ‘zed_log_pipe_wait’: zed_log.c:141:3: warning: implicit declaration of function ‘read’ n = read(_ctx.pipe_fd[0], &c, sizeof (c)); The [-Wimplicit-function-declaration] at the end of each warning has been removed to meet comment style requirements. The man pages say to include <sys/types.h> and <unistd.h>. Doing that silences the warnings. Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #5993
Diffstat (limited to 'cmd/zed')
-rw-r--r--cmd/zed/zed_log.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/zed/zed_log.c b/cmd/zed/zed_log.c
index 0697b7175..5a3f2dbdb 100644
--- a/cmd/zed/zed_log.c
+++ b/cmd/zed/zed_log.c
@@ -18,7 +18,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <syslog.h>
+#include <unistd.h>
#include "zed_log.h"
#define ZED_LOG_MAX_LOG_LEN 1024