Xref: utzoo news.software.b:4247 comp.sys.att:8902 Path: utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!attcan!telly!eci386!woods From: woods@eci386.uucp (Greg A. Woods) Newsgroups: news.software.b,comp.sys.att Subject: Re: rn vs. Sys V questions Summary: why does everyone do this wrong! Message-ID: <1990Feb26.192405.25927@eci386.uucp> Date: 26 Feb 90 19:24:05 GMT References: <665@smcnet.UUCP> Reply-To: woods@eci386.UUCP (Greg A. Woods) Distribution: na Organization: Elegant Communications Inc., Toronto, Canada Lines: 103 In article <665@smcnet.UUCP> neal@smcnet.UUCP (Neal S. Pollack) writes: > I am trying to install rn on an AT&T 3B2/600 with SYS V rel 3.2 > software. Thanks to help from the net, I was able to get it to > compile. However, it does not work. I guess the help you got from the net was wrong. SysVr3+ has standard directory routines (i.e. IEEE 1003.1 versions). DON'T use the ndir.[ch] that comes with rn. It may break on RFS or NFS, and probably on other strange filesystems (i.e. BSD :-) that some vendors ship with their SysV's (remember SysV doesn't necessarily always have UFS type filesystems). Here's what's necessary for rn patchlevel 40 and up. I imagine this will work on your P39 version too. (Yes, you should use , and let Configure use the opendir it finds in libc.a. This will work for any SysVr3+, or if you use Gwyn's libdirent.a. You should always use where available, and make the necessary adaptations to the code to conform to the IEEE1003.1 interface!) Index: ngdata.c *** Standard Input Wed Dec 31 19:00:00 1969 --- ngdata.c Wed Jun 14 19:16:31 1989 *************** *** 8,14 **** #include "EXTERN.h" #include "common.h" ! #include "ndir.h" #include "rcstuff.h" #include "rn.h" #include "intrp.h" --- 8,14 ---- #include "EXTERN.h" #include "common.h" ! #include #include "rcstuff.h" #include "rn.h" #include "intrp.h" *************** *** 185,191 **** ART_NUM floor; { register DIR *dirp; ! register struct direct *dp; register ART_NUM min = 1000000; register ART_NUM maybe; register char *p; --- 185,191 ---- ART_NUM floor; { register DIR *dirp; ! register struct dirent *dp; register ART_NUM min = 1000000; register ART_NUM maybe; register char *p; *************** *** 194,200 **** dirp = opendir(dirname); if (!dirp) return 0; ! while ((dp = readdir(dirp)) != Null(struct direct *)) { if ((maybe = atol(dp->d_name)) < min && maybe > floor) { for (p = dp->d_name; *p; p++) if (!isdigit(*p)) --- 194,200 ---- dirp = opendir(dirname); if (!dirp) return 0; ! while ((dp = readdir(dirp)) != Null(struct dirent *)) { if ((maybe = atol(dp->d_name)) < min && maybe > floor) { for (p = dp->d_name; *p; p++) if (!isdigit(*p)) There's also a problem with sprintf(), even in P44. I didn't bother to #ifdef it, so don't give the patched source back to a BSD site! Index: common.h *** Standard Input Wed Dec 31 19:00:00 1969 --- common.h Mon Nov 14 21:31:20 1988 *************** *** 670,676 **** char *getenv(); char *strcat(); char *strcpy(); ! char *sprintf(); EXT char buf[LBUFLEN+1]; /* general purpose line buffer */ EXT char cmd_buf[CBUFLEN]; /* buffer for formatting system commands */ --- 670,676 ---- char *getenv(); char *strcat(); char *strcpy(); ! int sprintf(); EXT char buf[LBUFLEN+1]; /* general purpose line buffer */ EXT char cmd_buf[CBUFLEN]; /* buffer for formatting system commands */ -- Greg A. Woods woods@{eci386,gate,robohack,ontmoh,tmsoft,gpu.utcs.UToronto.CA,utorgpu.BITNET} +1-416-443-1734 [h] +1-416-595-5425 [w] VE3-TCP Toronto, Ontario CANADA