$NetBSD: patch-bj,v 1.2 2005/05/29 14:38:33 wiz Exp $ --- glunix/src/part/mpart.cc.orig 1997-09-05 21:30:01.000000000 +0200 +++ glunix/src/part/mpart.cc @@ -46,6 +46,7 @@ #define __THIS_MODULE MODULE_PART #include +#include #include #include #include @@ -270,13 +271,18 @@ Part_SpawnDaemon(char *path, char **argv } if (pid == 0) { // Child executes here +#ifndef __NetBSD__ close(pipeFds[1]); +#endif if (dup2(pipeFds[0], STDIN_FILENO) < 0) { DE("dup2(STDIN) failed: %s\n", strerror(errno)); exit(-1); } - +#ifdef __NetBSD__ + if (dup2(pipeFds[1], STDOUT_FILENO) < 0) { +#else if (dup2(pipeFds[0], STDOUT_FILENO) < 0) { +#endif DE("dup2(STDOUT) failed: %s\n", strerror(errno)); exit(-1); } @@ -291,10 +297,15 @@ Part_SpawnDaemon(char *path, char **argv DE("CloseOneExec(%d) failed, pipeFds[0,1] = (%d,%d): %s\n", pipeFds[1], pipeFds[0], pipeFds[1], strerror(errno)); } +#ifndef __NetBSD__ close(pipeFds[0]); - +#endif *pidPtr = pid; +#ifdef __NetBSD__ + *fdPtr = pipeFds[0]; +#else *fdPtr = pipeFds[1]; +#endif return True; }