diff options
author | rsc <devnull@localhost> | 2006-06-26 05:45:25 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-06-26 05:45:25 +0000 |
commit | f936548b5e1dc6cff6e422867a4265c64ebbcfd1 (patch) | |
tree | ca76fda8c5a43d7bf28718ae5453f3138a1b9311 | |
parent | 95e92f180a92afc36d4e32cb9389d46f4831b2b8 (diff) | |
download | plan9port-f936548b5e1dc6cff6e422867a4265c64ebbcfd1.tar.gz plan9port-f936548b5e1dc6cff6e422867a4265c64ebbcfd1.tar.bz2 plan9port-f936548b5e1dc6cff6e422867a4265c64ebbcfd1.zip |
slow mode for debugging
-rw-r--r-- | src/cmd/devdraw/x11-srv.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c index a5c5bf11..f0b9dc28 100644 --- a/src/cmd/devdraw/x11-srv.c +++ b/src/cmd/devdraw/x11-srv.c @@ -87,6 +87,7 @@ void matchresized(void); int fdnoblock(int); int chatty; +int drawsleep; void usage(void) @@ -96,6 +97,14 @@ usage(void) } void +bell(void *v, char *msg) +{ + if(strcmp(msg, "alarm") == 0) + drawsleep = drawsleep ? 0 : 1000; + noted(NCONT); +} + +void main(int argc, char **argv) { int n, top, firstx; @@ -110,9 +119,12 @@ main(int argc, char **argv) default: usage(); }ARGEND + + /* + * Ignore arguments. They're only for good ps -a listings. + */ - if(argc != 0) - usage(); + notify(bell); fdin.rp = fdin.wp = fdin.buf; fdin.ep = fdin.buf+sizeof fdin.buf; @@ -155,7 +167,10 @@ main(int argc, char **argv) if(chatty) fprint(2, "select %d...\n", top+1); /* wait for something to happen */ + again: if(select(top+1, &rd, &wr, &xx, NULL) < 0){ + if(errno == EINTR) + goto again; if(chatty) fprint(2, "select failure\n"); exits(0); |