tslow mode for debugging - plan9port - [fork] Plan 9 from user space (HTM) git clone git://src.adamsgaard.dk/plan9port (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit f936548b5e1dc6cff6e422867a4265c64ebbcfd1 (DIR) parent 95e92f180a92afc36d4e32cb9389d46f4831b2b8 (HTM) Author: rsc <devnull@localhost> Date: Mon, 26 Jun 2006 05:45:25 +0000 slow mode for debugging Diffstat: M src/cmd/devdraw/x11-srv.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) --- (DIR) diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c t@@ -87,6 +87,7 @@ void matchresized(void); int fdnoblock(int); int chatty; +int drawsleep; void usage(void) t@@ -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; t@@ -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; t@@ -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);