Fix for OpenBSD

This commit is contained in:
Michiel Broek 2005-08-30 21:07:12 +00:00
parent eb92c60896
commit 9b3491740c

View File

@ -221,6 +221,9 @@ int main(int argc, char *argv[])
* Find out the name of our parent. * Find out the name of our parent.
*/ */
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
#if defined(__OpenBSD__)
// FIXME: no /proc on OpenBSD
#else
ppid = getppid(); ppid = getppid();
snprintf(temp, PATH_MAX, "/proc/%d/cmdline", ppid); snprintf(temp, PATH_MAX, "/proc/%d/cmdline", ppid);
if ((fp = fopen(temp, "r")) == NULL) { if ((fp = fopen(temp, "r")) == NULL) {
@ -237,6 +240,7 @@ int main(int argc, char *argv[])
free(parent); free(parent);
exit(1); exit(1);
} }
#endif
memset(args, 0, sizeof(args)); memset(args, 0, sizeof(args));