Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!munnari.oz.au!metro!otc!gregm From: gregm@otc.otca.oz.au (Greg McFarlane) Newsgroups: comp.windows.x Subject: Xmon - patch 1 Message-ID: <1911@otc.otca.oz> Date: 13 Sep 90 00:16:27 GMT Sender: news@otc.otca.oz Reply-To: gregm@otc.otca.oz.au (Greg McFarlane) Organization: OTC Development Unit, Australia Lines: 232 Keywords: Submitted-by: gregm@otc.otca.oz.au Archive-name: xmon/patch1 xmon patch 1 Here is patch 1 for xmon - an interactive X protocol monitor which was posted to comp.sources.x last week. It's an official patch. (You can take my word for it.) It has also been sent to the moderator of comp.sources.x, but it has not appeared there yet, so I'm posting it here as well. 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