[comp.windows.x] minor Xaw fix

erickson@GLACIER.ICS.UCI.EDU (Gary Scott Erickson) (02/15/89)

VERSION:
    R3

CLIENT MACHINE and OPERATING SYSTEM:
    Sun 386i/150 running SunOS 4.0.1

AREA:
    Xaw, xload

SYNOPSIS:
    When xload is run, it complains that it can't get
    namelist from /vmunix.

DESCRIPTION:
    In the Xaw library function GetLoadPoint(), the namelist of
    the kernel is read into namelist[0].  Then, namelist[0].n_type
    is compared to 0 to see if data has been found.  But, according
    to the Sun 386i manual page for nlist() :

        "On Sun-2, Sun-3, and Sun-4 systems, type entries are set  to
	 0  if  the  file  cannot be read or if it does not contain a
	 valid name list.

	 On Sun386i systems, the type entries may be zero  even  when
	 the  name list succeeded, but the value entries will be zero
	 only when the file cannot be read  or  does  not  contain  a
	 valid  name  list.  Therefore, on Sun386i systems, the value
	 entry can be used to  determine  whether  the  command  suc-
	 ceeded."

    Also, the default KERNEL_LOAD_VARIABLE is incorrect for a Sun386i.

REPEAT BY:
    xload

SAMPLE FIX:
*** lib/Xaw/_Load.c	Sun Oct 23 11:44:23 1988
--- lib/Xaw/Load.c	Tue Feb 14 16:15:15 1989
***************
*** 490,495 ****
--- 490,498 ----
  #ifdef sequent
  #define KERNEL_FILE "/dynix"
  #endif /* sequent */
+ #ifdef sun386
+ #define KERNEL_LOAD_VARIABLE "avenrun"
+ #endif /* sun386 */
  /*
   * provide default for everyone else
   */
***************
*** 550,556 ****
--- 553,563 ----
  	
  	if(!init)   {
  	    nlist( KERNEL_FILE, namelist);
+ #ifdef sun386
+ 	    if (namelist[LOADAV].n_value == 0){
+ #else /* not sun386 */
  	    if (namelist[LOADAV].n_type == 0){
+ #endif /* sun386 */
  		xload_error("cannot get name list from", KERNEL_FILE);
  		exit(-1);
  	    }