未验证 提交 1d62e402 编写于 作者: S Shreedhar Hardikar 提交者: GitHub

Include <signal.h> to fix compiler error on MacOS (#11135)

After commit aef99680 master build on macOS started to fail with
errors like this:

execute_pipe.c:197:6: error: implicit declaration of function 'kill' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if (kill(pid, 0) == 0) /* process exists */
            ^
1 error generated.

POSIX only guarantees that kill(2) be provided through <signal.h>. It
turns out we were relying on <unistd.h> to indirectly include <signal.h>
for us. But that's a GNU-ism.

This also showed up in Travis CI on greenplum-db/gpdb#11121
(https://travis-ci.org/github/greenplum-db/gpdb/builds/742342058) before
it got merged into master.
Co-authored-by: NShreedhar Hardikar <hardikar@cs.wisc.edu>
Co-authored-by: NJesse Zhang <sbjesse@gmail.com>
上级 7f558913
......@@ -22,6 +22,7 @@
#include <unistd.h>
#include <sys/wait.h>
#include <signal.h>
#include "postgres.h"
#include "storage/execute_pipe.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册