if (watching_stdin_p) {
if (FD_ISSET(stdin_fd, &rfds)) {
ret = handle_stdin_events(firstjob, stdin_fd);
- if (ret < 0)
+ if (ret < 0) {
watching_stdin_p = FALSE;
+ FD_CLR(stdin_fd, &rfds);
+ }
events += ret;
}
if (watching_stdin_p)
--- /dev/null
+#!/bin/bash
+
+# intended to test the behavior of 'dot -Tx11' to a succession of graphs on stdin
+# with an interval in between, which should be enough to allow each graph to be seen
+
+# usage: ./slow_graph_stream_test.sh | dot -Tx11
+
+while true; do
+ echo "digraph {rankdir=RL; 0->{1 2}}"
+ sleep 2
+ echo "digraph {rankdir=LR; 0->{1 2}}"
+ sleep 2
+done
if ! test -w "$f"; then error "$f is not writable"; fi
# dot -Txlib watches the file $f for changes using inotify()
-# run it in an xterm window to handle any stderr
-xterm -e dot -Txlib "$f" 2>/dev/null &
+dot -Txlib "$f" 2>/dev/null &
# open an editor on the file $f (could be any editor; gvim &'s itself)
exec $editor "$f"