diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2010-03-11 16:16:49 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2010-03-11 16:16:49 +0800 |
commit | 3b8249493fdb4ed2325d8d5371cebda5c6a98bf4 (patch) | |
tree | cf94d67cbf5b6ccd978f66d19546ec26a00b1833 | |
parent | ab06b604f5b75870dbb2aeae5be7585f703145e8 (diff) |
Check stdout a tty before flushing.
-rwxr-xr-x | examples/data/scripts/uzbl-cookie-daemon | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/data/scripts/uzbl-cookie-daemon b/examples/data/scripts/uzbl-cookie-daemon index fde8b8e..ed88de4 100755 --- a/examples/data/scripts/uzbl-cookie-daemon +++ b/examples/data/scripts/uzbl-cookie-daemon @@ -269,8 +269,9 @@ def daemonize(): sys.stderr.write("fork #2 failed") sys.exit(1) - sys.stdout.flush() - sys.stderr.flush() + if sys.stdout.isatty(): + sys.stdout.flush() + sys.stderr.flush() devnull = '/dev/null' stdin = file(devnull, 'r') |