From: John Ellson Date: Thu, 1 Dec 2016 03:08:08 +0000 (-0500) Subject: partial fix for #1175 X-Git-Tag: untagged-46da481a5543e7a1bf8e X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f4f80e00b23b257ef30070fd66dfc36e7cf46fa;p=graphviz partial fix for #1175 --- diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index c9bd292ee..a7883fe09 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -573,8 +573,10 @@ static void xlib_finalize(GVJ_t *firstjob) 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) diff --git a/plugin/xlib/slow_graph_stream_test.sh b/plugin/xlib/slow_graph_stream_test.sh new file mode 100755 index 000000000..cd6b38ec9 --- /dev/null +++ b/plugin/xlib/slow_graph_stream_test.sh @@ -0,0 +1,13 @@ +#!/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 diff --git a/plugin/xlib/vimdot.sh b/plugin/xlib/vimdot.sh index cd40fccbc..a8d25b5b2 100755 --- a/plugin/xlib/vimdot.sh +++ b/plugin/xlib/vimdot.sh @@ -38,7 +38,6 @@ fi 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"