Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!utah-gr!spline!thomas From: thomas%spline.uucp@utah-gr.UUCP (Spencer W. Thomas) Newsgroups: comp.windows.x Subject: Re: xrload Message-ID: <2113@utah-gr.UUCP> Date: Thu, 13-Aug-87 13:56:19 EDT Article-I.D.: utah-gr.2113 Posted: Thu Aug 13 13:56:19 1987 Date-Received: Sat, 15-Aug-87 09:43:32 EDT References: <8708131105.AA04176@decwrl.dec.com> Sender: news@utah-gr.UUCP Reply-To: thomas%spline.UUCP@utah-gr.UUCP (Spencer W. Thomas) Distribution: world Organization: Univ of Utah CS Dept Lines: 85 I ported xrload to our HP bobcat system running HPUX (a SYSV variant with Berkeley networking). In the process I had to make a few system dependent changes, and I fixed a few bugs. Here is a diff listing from the original posting (the single file version). =Spencer ({ihnp4,decvax}!utah-cs!thomas, thomas@cs.utah.edu) *** .~xrload.c Thu Aug 13 11:51:26 1987 --- xrload.c Thu Aug 13 11:51:26 1987 *************** *** 11,14 **** --- 11,17 ---- #include + #include /* This must come first */ #include + #ifndef hpux #include + #endif #include *************** *** 15,17 **** #include ! #include #include --- 18,20 ---- #include ! #include /* Need to explicitly include this for HPUX */ #include *************** *** 27,28 **** --- 30,35 ---- + #ifndef RUPTIME + #define RUPTIME "/usr/ucb/ruptime" + #endif + #include "back.bitmap" *************** *** 253,255 **** hh = back_height + dd + theFont->height; ! rr = (ww-1)/2; } --- 260,262 ---- hh = back_height + dd + theFont->height; ! rr = (back_width - 1) / 2; /* radius related only to icon size */ } *************** *** 358,361 **** dup2 (iofd[1], 1); /* stdout to pipe */ ! execl ("/usr/ucb/ruptime", "ruptime", 0); ! perror ("can't exec /usr/ucb/ruptime"); exit (1); --- 365,369 ---- dup2 (iofd[1], 1); /* stdout to pipe */ ! execl (RUPTIME, "ruptime", 0); ! fprintf(stderr, "xrload: Can't exec "); ! perror (RUPTIME); exit (1); *************** *** 364,366 **** --- 372,378 ---- static char hstatus[8], junk[8]; + #ifndef hpux union wait status; + #else + long status; + #endif int nh = 0, nf; *************** *** 597 **** --- 609,620 ---- } + + #ifdef hpux + #include + dup2( fd1, fd2 ) /* Simulate dup2 with fcntl */ + int fd1, fd2; + { + close(fd2); + return fcntl( fd1, F_DUPFD, fd2 ); + } + + #endif =Spencer ({ihnp4,decvax}!utah-cs!thomas, thomas@cs.utah.edu)