From 3ee5facd769b111061569c3047a63d33efaa2aef Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sun, 20 Sep 2009 03:27:29 +0000 Subject: [PATCH] eof detection --- update-web-status.py | 5 ++++- update-xmpp-status.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/update-web-status.py b/update-web-status.py index e2eec66..c4fffa6 100755 --- a/update-web-status.py +++ b/update-web-status.py @@ -200,7 +200,7 @@ while True: if not os.path.exists(socketfile): logging.debug("Socketfile '%s' not found, waiting 5 secs" % socketfile) time.sleep(5) - continue + continue sockhandle = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockhandle.connect(socketfile) conn = os.fdopen(sockhandle.fileno()) @@ -212,6 +212,9 @@ while True: uwscfg.checkConfigUpdates() + if line == "": + raise Exception("EOF on Socket, daemon seems to have quit") + m = RE_STATUS.match(line) if not m is None: status = m.group(1) diff --git a/update-xmpp-status.py b/update-xmpp-status.py index 24aef04..a6d1331 100755 --- a/update-xmpp-status.py +++ b/update-xmpp-status.py @@ -283,6 +283,9 @@ while True: uwscfg.checkConfigUpdates() + if line == "": + raise Exception("EOF on Socket, daemon seems to have quit") + m = RE_STATUS.match(line) if not m is None: status = m.group(1) -- 1.7.10.4