Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!otc.otca.oz.au From: gregm@otc.otca.oz.au (Greg McFarlane) Newsgroups: comp.sources.x Subject: v09i030: Xmon - X Protocol Monitor, Patch1, Part01/01 Message-ID: <142276@sun.Eng.Sun.COM> Date: 12 Sep 90 08:29:21 GMT References: Sender: news@sun.Eng.Sun.COM Lines: 231 Approved: argv@sun.com Submitted-by: Greg McFarlane Posting-number: Volume 9, Issue 30 Archive-name: xmon/patch1 Patch-To: xmon: Volume 9, Issue 15-19 xmon patch 1 This patch fixes the following problems: 1. Long lines in the Imakefile were folded by the news software. 2. It should now compile on SYSV. You'll need to use -DSYSV. 3. It should now compile on machines that allow more than 128 open files. ---- Cut Here and unpack ---- #!/bin/sh # This is xmon, a shell archive (shar 3.32) # made 09/10/1990 07:43 UTC by gregm@otc.otca.oz.au # Source directory /u/projects/multi/xmux/xscope.based # # existing files will NOT be overwritten # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 4505 -rw-rw-r-- xmon.patch1 # if touch 2>&1 | fgrep 'amc' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= xmon.patch1 ============== if test X"$1" != X"-c" -a -f 'xmon.patch1'; then echo "File already exists: skipping 'xmon.patch1'" else echo "x - extracting xmon.patch1 (Text)" sed 's/^X//' << 'SHAR_EOF' > xmon.patch1 && Xxmon patch 1 X XThis patch fixes the following problems: X X1. Long lines in the Imakefile were folded by the news software. X2. It should now compile on SYSV. You'll need to use -DSYSV. X3. It should now compile on machines that allow more than 128 open files. X XIt makes patches to the following files: Xpatchlevel.h XImakefile Xmain.c Xselect_args.h X Xdiff -r -c patchlevel.h.old patchlevel.h X*** patchlevel.h.old Mon Sep 10 14:22:02 1990 X--- patchlevel.h Mon Sep 10 15:33:48 1990 X*************** X*** 1 **** X! #define PATCHLEVEL 0 X--- 1 ---- X! #define PATCHLEVEL 1 Xdiff -r -c Imakefile.old Imakefile X*** Imakefile.old Mon Sep 10 14:20:22 1990 X--- Imakefile Mon Sep 10 14:33:37 1990 X*************** X*** 15,24 **** X ComplexProgramTarget_1(xmond, $(LOCAL_LIBRARIES), ) X ComplexProgramTarget_2(xmonui, $(LOCAL_LIBRARIES), ) X X! SHARFILES = README xmon.man Imakefile Makefile $(SRCS1) $(SRCS2) X $(INCLUDE_FILES) X X shar: X! shar -n xmon -s "gregm@otc.otca.oz.au" -a -o xmon.shar -l 75 -x -c X $(SHARFILES) X X--- 15,24 ---- X ComplexProgramTarget_1(xmond, $(LOCAL_LIBRARIES), ) X ComplexProgramTarget_2(xmonui, $(LOCAL_LIBRARIES), ) X X! SHARFILES = README xmon.man Imakefile Makefile $(SRCS1) $(SRCS2) \ X $(INCLUDE_FILES) X X shar: X! shar -n xmon -s "gregm@otc.otca.oz.au" -a -o xmon.shar -l 75 -x -c \ X $(SHARFILES) X Xdiff -r -c main.c.old main.c X*** main.c.old Mon Sep 10 14:21:24 1990 X--- main.c Mon Sep 10 15:30:57 1990 X*************** X*** 11,16 **** X--- 11,19 ---- X #include /* for struct iovec, used by socket.h */ X #include /* for AF_INET, SOCK_STREAM, ... */ X #include /* for FIONCLEX, FIONBIO, ... */ X+ #ifdef SYSV X+ #include X+ #endif X #include /* struct sockaddr_in */ X #include /* struct servent * and struct hostent * */ X #include /* for EINTR, EADDRINUSE, ... */ X*************** X*** 27,33 **** X #define NUM_REQUESTS /* 128 */ 256 X #define NUM_EVENTS /* 40 */ 256 X X- X /* function prototypes: */ X /* main.c: */ X static void ScanArgs P((int argc , char **argv )); X--- 30,35 ---- X*************** X*** 57,62 **** X--- 59,68 ---- X static void SignalTSTP P((void )); X static void SignalCONT P((void )); X X+ #if (mskcnt>4) X+ static Bool ANYSET P((long *src)); X+ #endif X+ X /* end function prototypes */ X X Global Bool ignore_bytes; X*************** X*** 304,310 **** X--- 310,320 ---- X }; X X /* a few more parameter settings */ X+ #ifdef SYSV X+ fcntl(ConnectionSocket, F_SETFD, FD_CLOEXEC); X+ #else X ioctl(ConnectionSocket, FIOCLEX, 0); X+ #endif X ioctl(ConnectionSocket, FIONBIO, &ON); X X debug(4,(stderr, "Listening on FD %d\n", ConnectionSocket)); X*************** X*** 919,925 **** X--- 929,939 ---- X panic("Can't connect to Client"); X } X X+ #ifdef SYSV X+ fcntl(ClientFD, F_SETFD, FD_CLOEXEC); X+ #else X ioctl(ClientFD, FIOCLEX, 0); X+ #endif X ioctl(ClientFD, FIONBIO, &ON); X return(ClientFD); X } X*************** X*** 1064,1066 **** X--- 1078,1094 ---- X fprintf(stderr, "%s\n", s); X exit(1); X } X+ X+ #if (mskcnt>4) X+ static Bool X+ ANYSET(src) X+ long src[]; X+ { X+ int cri; X+ X+ for (cri = 0; cri < mskcnt; cri++) X+ if (src[cri]) X+ return 1; X+ return 0; X+ } X+ #endif Xdiff -r -c select_args.h.old select_args.h X*** select_args.h.old Mon Sep 10 14:21:49 1990 X--- select_args.h Mon Sep 10 14:42:11 1990 X*************** X*** 96,111 **** X #define MASKANDSETBITS(dst, b1, b2) \ X { int cri; \ X for (cri=0; cri