Path: utzoo!utstat!news-server.csri.toronto.edu!math.lsa.umich.edu!zaphod.mps.ohio-state.edu!usc!hacgate!ladcgw.ladc.bull.com!melb.bull.oz.au!taureau.melb.bull.oz.au!sun0!sjg From: sjg@sun0.melb.bull.oz.au (Simon J. Gerraty) Newsgroups: news.software.nntp Subject: nntp-1.5.8 server/spawn.c patch for stupid exec's Message-ID: <1990Oct5.011738.9167@melb.bull.oz.au> Date: 5 Oct 90 01:17:38 GMT Sender: news@melb.bull.oz.au (USENET News Account) Organization: Bull HN Information Systems Australia Lines: 26 Some UNIX systems cannot handle exec'ing a shell script. These are usually the same systems whose shell's do not grok #!/bin/sh The following simple patch, handles the case where execl fails due to ENOEXEC and simply punts the thing to /bin/sh to try. *** spawn.c~1~ Thu Oct 4 14:34:50 1990 --- spawn.c Thu Oct 4 15:09:14 1990 *************** *** 164,169 **** --- 164,175 ---- } execl(path, name, flag, (char *) NULL); + /* + * 90-10-04 + * stupid exec()'s barf trying to exec a shell script! + */ + if (errno == ENOEXEC) + execl("/bin/sh", "-c", path, flag, (char *) NULL); fprintf(stderr, "spawn: execl "); perror(path); _exit(-1); /* Error */ -- Simon J. Gerraty #include /* imagine something *very* witty here */