*** /dev/null	Wed Oct 27 13:34:09 1993
--- conf/BFLY.m4	Wed Oct 27 10:25:39 1993
***************
*** 0 ****
--- 1,19 ----
+ divert(-1)
+ undefine(`len')
+ #
+ # append an underscore to FORTRAN function names
+ #
+ define(`FUNCTION',`$1_')
+ #
+ # FORTRAN character strings are passed as follows:
+ # a pointer to the base of the string is passed in the normal
+ # argument list, and the length is passed by value as an extra
+ # argument, after all of the other arguments.
+ #
+ define(`ARGS',`($1`'undivert(1))')
+ define(`SAVE',`divert(1)$1`'divert(0)')
+ define(`STRING_ARG',`$1_ptr`'SAVE(`, $1_len')')
+ define(`STRING_ARG_DECL',`char * $1_ptr; int $1_len')
+ define(`STRING_LEN',`$1_len')
+ define(`STRING_PTR',`$1_ptr')
+ divert(0)
*** /dev/null	Wed Oct 27 13:34:11 1993
--- conf/MASPAR.m4	Wed Oct 27 13:16:37 1993
***************
*** 0 ****
--- 1,19 ----
+ divert(-1)
+ undefine(`len')
+ #
+ # append an underscore to FORTRAN function names
+ #
+ define(`FUNCTION',`$1_')
+ #
+ # FORTRAN character strings are passed as follows:
+ # a pointer to the base of the string is passed in the normal
+ # argument list, and the length is passed by value as an extra
+ # argument, after all of the other arguments.
+ #
+ define(`ARGS',`($1`'undivert(1))')
+ define(`SAVE',`divert(1)$1`'divert(0)')
+ define(`STRING_ARG',`$1_ptr`'SAVE(`, $1_len')')
+ define(`STRING_ARG_DECL',`char * $1_ptr; int $1_len')
+ define(`STRING_LEN',`$1_len')
+ define(`STRING_PTR',`$1_ptr')
+ divert(0)
*** ../netlib/pvm3.2.3/patches/Contents	Tue Oct 12 11:10:14 1993
--- patches/Contents	Wed Oct 27 13:34:06 1993
***************
*** 1,4 ****
--- 1,24 ----
  
+ patch #4
+ version:
+     3.2.3 -> 3.2.4
+     interoperable with v 3.2.[0123].
+ files:
+     create conf/BFLY.m4
+     create conf/MASPAR.m4
+     patch  patches/Contents
+     patch  src/global.h
+     patch  src/lpvmmimd.c
+     patch  src/patchlevel.h
+     patch  src/pvmd.c
+     patch  src/startup.c
+ what:
+     . fixed pvmd so it doesn't use fds 0..2 for anything, and
+       opens them as /dev/null.
+     . fixed bug in pvmd - didn't ping other pvmds when HTUPD state.
+     . lpvmmimd.c declares global var pvm_useruid because pvmcruft.c
+       now needs it (broken in 3.2.3).
+ 
  patch #3
  version:
      3.2.2 -> 3.2.3
*** ../netlib/pvm3.2.3/src/global.h	Tue Oct 12 11:10:15 1993
--- src/global.h	Wed Oct 27 13:32:21 1993
***************
*** 32,37 ****
--- 32,40 ----
   *	Generic includes.
   *
  $Log: global.h,v $
+  * Revision 1.5  1993/10/27  17:32:16  manchek
+  * version change
+  *
   * Revision 1.4  1993/10/12  14:44:31  manchek
   * version change
   *
***************
*** 49,55 ****
  
  /* release version */
  
! #define	PVM_VER	"3.2.3"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
--- 52,58 ----
  
  /* release version */
  
! #define	PVM_VER	"3.2.4"
  
  /* UDPMAXLEN should be set to the largest UDP message length
     your system can handle. */
*** ../netlib/pvm3.2.3/src/lpvmmimd.c	Mon Aug 30 19:29:33 1993
--- src/lpvmmimd.c	Fri Oct 15 10:54:09 1993
***************
*** 32,37 ****
--- 32,40 ----
   *	Libpvm core for MPP environment.
   *
  $Log: lpvmmimd.c,v $
+  * Revision 1.2  1993/10/15  14:53:30  manchek
+  * define pvm_useruid as it's needed in pvmcruft.c
+  *
   * Revision 1.1  1993/08/30  23:26:48  manchek
   * Initial revision
   *
***************
*** 144,149 ****
--- 147,153 ----
  int pvmoutcod = 0;
  int pvmtrctid = 0;						/* trace dst and code */
  int pvmtrccod = 0;
+ int pvm_useruid = -1;					/* user's unix uid */
  
  
  #if defined(IMA_PGON) || defined(IMA_I860)
***************
*** 186,192 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.1 1993/08/30 23:26:48 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static char etext[512];					/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
--- 190,196 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: lpvmmimd.c,v 1.2 1993/10/15 14:53:30 manchek Exp $";
  static int debugmask = 0;				/* which debugging info */
  static char etext[512];					/* scratch for error log */
  static struct umbuf *rxfrag = 0;		/* not-assembled incm msgs */
*** ../netlib/pvm3.2.3/src/patchlevel.h	Tue Oct 12 11:10:15 1993
--- src/patchlevel.h	Wed Oct 27 13:32:30 1993
***************
*** 1,3 ****
  
! #define PATCHLEVEL 3
  
--- 1,3 ----
  
! #define PATCHLEVEL 4
  
*** ../netlib/pvm3.2.3/src/pvmd.c	Tue Oct 12 11:10:16 1993
--- src/pvmd.c	Mon Oct 25 16:53:23 1993
***************
*** 32,37 ****
--- 32,42 ----
   *	Mr. pvm daemon.
   *
  $Log: pvmd.c,v $
+  * Revision 1.9  1993/10/25  20:51:11  manchek
+  * make sure pvmd doesn't use 0..2 for sockets, etc. - open /dev/null.
+  * added code to change process group/disassoc. from tty (TTYDIS).
+  * ping other pvmds also when run state is PVMDHTUPD
+  *
   * Revision 1.8  1993/10/12  14:18:37  manchek
   * fixed bug in locloutput() - hung if write() returned 0
   *
***************
*** 65,70 ****
--- 70,76 ----
  #include <bsd/sys/types.h>
  #else
  #include <sys/types.h>
+ #include <sys/ioctl.h>
  #endif
  #include <sys/time.h>
  #include <sys/wait.h>
***************
*** 122,127 ****
--- 128,137 ----
  #define	min(a,b)	((a)<(b)?(a):(b))
  #endif
  
+ #ifndef	TTYDIS
+ #define	TTYDIS	0
+ #endif
+ 
  #ifdef	STATISTICS
  struct statistics {
  	int selneg, selzer, selrdy;		/* neg, zero, ready selects */
***************
*** 194,200 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.8 1993/10/12 14:18:37 manchek Exp $";
  static int *deads = 0;			/* circ queue of dead pids */
  static char pvmtxt[512];		/* scratch for error log */
  static int ndead = 0;			/* len of deads */
--- 204,210 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: pvmd.c,v 1.9 1993/10/25 20:51:11 manchek Exp $";
  static int *deads = 0;			/* circ queue of dead pids */
  static char pvmtxt[512];		/* scratch for error log */
  static int ndead = 0;			/* len of deads */
***************
*** 222,227 ****
--- 232,243 ----
  	struct passwd *pe;
  	char hna[128];
  
+ 	/* make sure 0, 1, 2 are in use */
+ 
+ 	(void)open("/dev/null", O_RDONLY, 0);
+ 	(void)open("/dev/null", O_RDONLY, 0);
+ 	(void)open("/dev/null", O_RDONLY, 0);
+ 
  	if ((pvm_useruid = getuid()) == -1) {
  		pvmlogerror("main() can't getuid()\n");
  		pvmbailout(0);
***************
*** 312,317 ****
--- 328,349 ----
  	else							/* master pvmd */
  		master_config(name, argc, argv);
  
+ #if TTYDIS & 8
+ 	setsid();
+ #endif
+ #if TTYDIS & 4
+ 	setpgid(0, 0);
+ #endif
+ #if TTYDIS & 2
+ 	setpgrp(0, 0);
+ #endif
+ #if TTYDIS & 1
+ 	if ((i = open("/dev/tty", O_RDWR, 0)) != -1) {
+ 		(void)ioctl(i, TIOCNOTTY, 0);
+ 		(void)close(i);
+ 	}
+ #endif
+ 
  	myhostpart = hosts->ht_local << (ffs(tidhmask) - 1);
  	mytid = myhostpart | TIDPVMD;
  
***************
*** 800,806 ****
  		if (TVXLTY(&tping, &tnow)) {
  			if (debugmask & (PDMPACKET|PDMSELECT))
  				pvmlogerror("work() ping timer\n");
! 			if (runstate == PVMDNORMAL) {
  				do {
  					if (++lastpinged > hosts->ht_last)
  						lastpinged = 1;
--- 832,838 ----
  		if (TVXLTY(&tping, &tnow)) {
  			if (debugmask & (PDMPACKET|PDMSELECT))
  				pvmlogerror("work() ping timer\n");
! 			if (runstate == PVMDNORMAL || runstate == PVMDHTUPD) {
  				do {
  					if (++lastpinged > hosts->ht_last)
  						lastpinged = 1;
*** ../netlib/pvm3.2.3/src/startup.c	Tue Oct 12 11:10:16 1993
--- src/startup.c	Mon Oct 25 16:54:59 1993
***************
*** 32,37 ****
--- 32,41 ----
   *	Exec more pvmds.  It's good for you.
   *
  $Log: startup.c,v $
+  * Revision 1.3  1993/10/25  20:53:51  manchek
+  * fixed a few typos in error log messages.
+  * added code to close all fds and reopen 0..2 as /dev/null
+  *
   * Revision 1.2  1993/10/04  20:30:30  manchek
   * mksocks() now uses pvmdsockfile() instead of TDSOCKNAME
   *
***************
*** 143,149 ****
   **           **
   ***************/
  
! static char rcsid[] = "$Id: startup.c,v 1.2 1993/10/04 20:30:30 manchek Exp $";
  static char pvmtxt[1024];		/* scratch for error log */
  
  
--- 147,153 ----
   **           **
   ***************/
  
! static char rcsid[] = "$Id: startup.c,v 1.3 1993/10/25 20:53:51 manchek Exp $";
  static char pvmtxt[1024];		/* scratch for error log */
  
  
***************
*** 415,420 ****
--- 419,425 ----
  	struct hostent *he;
  	struct hostd *hp;
  	struct hostd *hp2;
+ 	int i;
  
  	if (argc > 2) {
  		pvmlogerror("usage: pvmd3 [-ddebugmask] [-nhostname] [hostfile]\n");
***************
*** 430,436 ****
  	hosts->ht_local = 1;
  
  	if (!(he = gethostbyname(hn))) {
! 		sprintf(pvmtxt, "main() %s: can't gethostbyname\n", hn);
  		pvmlogerror(pvmtxt);
  		pvmbailout(0);
  	}
--- 435,441 ----
  	hosts->ht_local = 1;
  
  	if (!(he = gethostbyname(hn))) {
! 		sprintf(pvmtxt, "master_config() %s: can't gethostbyname\n", hn);
  		pvmlogerror(pvmtxt);
  		pvmbailout(0);
  	}
***************
*** 474,479 ****
--- 479,499 ----
  	epaths = pathsep(hp->hd_epath, ':', myarchname, '%');
  	debugger = hp->hd_bpath ? hp->hd_bpath : STRALLOC(DEFDEBUGGER);
  
+ 	/* close everything but our sockets */
+ 
+ 	for (i = getdtablesize(); --i >= 0; )
+ /* XXX don't like this - hard to maintain */
+ 		if (i != netsock && i != ppnetsock && i != loclsock && i != log_fd)
+ 			(void)close(i);
+ 
+ 	/* reopen 0, 1, 2*/
+ 
+ 	(void)open("/dev/null", O_RDONLY, 0);
+ 	(void)open("/dev/null", O_WRONLY, 0);
+ 	(void)dup2(1, 2);
+ 
+ 	log_how &= ~1;
+ 
  	runstate = PVMDNORMAL;
  	return 0;
  }
***************
*** 557,573 ****
  		exit(0);
  	}
  
  	for (i = getdtablesize(); --i >= 0; )
  /* XXX don't like this - hard to maintain */
  		if (i != netsock && i != loclsock && i != log_fd)
  			(void)close(i);
  
! 	log_how &= ~1;
  
! 	if ((myunixpid = getpid()) == -1) {
! 		pvmlogerror("main() can't getpid()\n");
! 		pvmbailout(0);
! 	}
  
  	epaths = pathsep(STRALLOC(DEFBINDIR), ':', myarchname, '%');
  	debugger = STRALLOC(DEFDEBUGGER);
--- 577,596 ----
  		exit(0);
  	}
  
+ 	/* close everything but our sockets */
+ 
  	for (i = getdtablesize(); --i >= 0; )
  /* XXX don't like this - hard to maintain */
  		if (i != netsock && i != loclsock && i != log_fd)
  			(void)close(i);
  
! 	/* reopen 0, 1, 2*/
  
! 	(void)open("/dev/null", O_RDONLY, 0);
! 	(void)open("/dev/null", O_WRONLY, 0);
! 	(void)dup2(1, 2);
! 
! 	log_how &= ~1;
  
  	epaths = pathsep(STRALLOC(DEFBINDIR), ':', myarchname, '%');
  	debugger = STRALLOC(DEFDEBUGGER);
