[general] Put back support for platforms without pipe2(), see issue #239

This commit is contained in:
ejurgensen
2016-03-17 22:20:16 +01:00
parent ec43195633
commit b454a2fd60
11 changed files with 80 additions and 1 deletions

View File

@@ -4791,14 +4791,22 @@ int mpd_init(void)
v6enabled = cfg_getbool(cfg_getsec(cfg, "general"), "ipv6");
#ifdef HAVE_PIPE2
ret = pipe2(g_exit_pipe, O_CLOEXEC);
#else
ret = pipe(g_exit_pipe);
#endif
if (ret < 0)
{
DPRINTF(E_LOG, L_MPD, "Could not create pipe: %s\n", strerror(errno));
goto exit_fail;
}
#ifdef HAVE_PIPE2
ret = pipe2(g_cmd_pipe, O_CLOEXEC);
#else
ret = pipe(g_cmd_pipe);
#endif
if (ret < 0)
{
DPRINTF(E_LOG, L_MPD, "Could not create command pipe: %s\n", strerror(errno));