]> git.proxmox.com Git - mirror_zfs.git/commit
Add missing includes to zed_log.c
authorRichard Yao <ryao@gentoo.org>
Sat, 8 Apr 2017 17:14:14 +0000 (13:14 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Apr 2017 15:57:25 +0000 (08:57 -0700)
commitbc482ac2ed80d77cf0186ccf670e02545f4ba883
tree9274de8a6c870ddcf3a651517ec2b86473f81823
parentdd49132a1d727c7363bbad82f390c06c40d140c6
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 <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Closes #5993
cmd/zed/zed_log.c