summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hostwatch.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/hostwatch.py b/hostwatch.py
index d77a58f..66e7461 100644
--- a/hostwatch.py
+++ b/hostwatch.py
@@ -13,7 +13,11 @@ _nmb_ok = True
_smb_ok = True
hostnames = {}
queue = {}
-null = open('/dev/null', 'rb+')
+try:
+ null = open('/dev/null', 'wb')
+except IOError, e:
+ log('warning: %s\n' % e)
+ null = os.popen("sh -c 'while read x; do :; done'", 'wb', 4096)
def _is_ip(s):