issues with pike 0.6 and bsd/os 4.0.1
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=458
Reference: http://5stops.com/roxen-1.3+vi.patch
Reported by eric lindvall, eric@nack.net
there are a bunch of problems getting roxen/pike to compile and work on bsd/os 4.0.1. the first issue is that the pike configure scripts assume that you want to link with shlicc, which is no longer true with bsd/os 4.0.
there are a couple other issues that i have found. first of all, dup2(2) does not like it when oldd == newd: dup2(2,2) will return errno 22 (EINVAL).
the second issue is that setgroups(2) does not like ngroups being 0. setgroups(0,x) is not something that is liked.
this is the patch that should make roxen-1.3 compile on bsd/os 4.0. obviously the fix to make configure not use shlicc is not acceptable for primetime use, as i have not done the check to make sure that the version of bsd/os is 4.0.
--- roxen_1.3.122/pike/0.6/src/configure Tue Aug 24 19:29:09 1999
+++ roxen_1.3.122+vi/pike/0.6/src/configure Sat Sep 30 11:51:26 2000
@@ -1258,9 +1258,9 @@
echo "SunOS. Adding -D__USE_FIXED_PROTOTYPES__"
CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
;;
- BSD/OS*)
- LD="$BINDIR/smartlink shlicc"
- ;;
+# BSD/OS*)
+# LD="$BINDIR/smartlink shlicc"
+# ;;
UnixWare*)
if test "$GCC" != "yes"; then
# We are using built-in inline function
@@ -9723,7 +9723,7 @@
FreeBSD*) LDSHARED="ld -Bshareable";;
NetBSD) LDSHARED="ld -Bshareable";;
OpenBSD*) LDSHARED="ld -Bshareable";;
- BSD/OS*) LDSHARED="shlicc -r";;
+# BSD/OS*) LDSHARED="shlicc -r";;
SCO_SV*) LDSHARED="cc -G -KPIC -Wl,-Bexport";;
UNIX_SV) LDSHARED="ld -G";;
UnixWare)
--- roxen_1.3.122/pike/0.6/src/signal_handler.c Mon May 24 12:50:30 1999
+++ roxen_1.3.122+vi/pike/0.6/src/signal_handler.c Sat Sep 30 13:01:44
2000
@@ -1981,8 +1981,8 @@
buf[1]);
break;
case PROCE_DUP2:
- error("Process.create_process(): dup2() failed. errno:%d\n",
- buf[1]);
+ error("Process.create_process(): dup2(x,%d) failed. errno:%d\n",
+ buf[2], buf[1]);
break;
case PROCE_SETGID:
error("Process.create_process(): setgid(%d) failed. errno:%d\n",
@@ -2115,7 +2115,7 @@
int fd;
for(fd=0; fd<3; fd++)
{
- if(stds[fd])
+ if(stds[fd] && stds[fd] != fd)
if(dup2(stds[fd], fd) < 0)
PROCERROR(PROCE_DUP2, fd);
}
@@ -2145,7 +2145,7 @@
#endif
#ifdef HAVE_SETGROUPS
-
if(storage.wanted_gids)
-
if(storage.wanted_gids && storage.num_wanted_gids) { if(setgroups(storage.num_wanted_gids, storage.wanted_gids)) {