From 04c34cb1bbac32d3c7aee184faed184056485ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 1 Jan 1998 16:56:02 -0800 Subject: [PATCH] now handles the absence of fork() Rev: lib/modules/Process.pmod:1.13 --- lib/modules/Process.pmod | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index 8a6413b42c..8edb8c486b 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -26,7 +26,11 @@ varargs int spawn(string s,object stdin,object stdout,object stderr, { int pid; +#if constant(fork) pid=fork(); +#else + pid=-1; +#endif if(pid==-1) error("No more processes.\n"); @@ -81,6 +85,7 @@ string popen(string s) return t; } +#if constant(fork) void system(string s) { object p; @@ -109,12 +114,15 @@ void system(string s) exit(69); } } - -constant fork = predef::fork; -constant exece = predef::exece; +constant fork = predef::fork; +#endif +#if constant(exece) +constant exece = predef::exece; +#endif +#if constant(fork) class Spawn { object stdin; @@ -225,3 +233,4 @@ class Spawn // int result(); // array rusage(); } +#endif -- GitLab