summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-05-05 04:57:00 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-05-05 04:57:00 -0400
commitf574ec49f88869541f7b9e265ec7abd5e6aaec1e (patch)
tree882b07cc99acc9dd9e188741af4d0ac72ea1fc31 /gps
parent48548c8b3feee14da62d5a5e9932425c72f4afe9 (diff)
downloadgpsd-f574ec49f88869541f7b9e265ec7abd5e6aaec1e.tar.gz
NUL-terminate write to control socket to avoid junk in log messages.
Diffstat (limited to 'gps')
-rw-r--r--gps/fake.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gps/fake.py b/gps/fake.py
index 3eb07029..4f6dc0bf 100644
--- a/gps/fake.py
+++ b/gps/fake.py
@@ -351,19 +351,19 @@ class DaemonInstance:
def add_device(self, path):
"Add a device to the daemon's internal search list."
if self.__get_control_socket():
- self.sock.sendall("+%s\r\n" % path)
+ self.sock.sendall("+%s\r\n\x00" % path)
self.sock.recv(12)
self.sock.close()
def remove_device(self, path):
"Remove a device from the daemon's internal search list."
if self.__get_control_socket():
- self.sock.sendall("-%s\r\n" % path)
+ self.sock.sendall("-%s\r\n\x00" % path)
self.sock.recv(12)
self.sock.close()
def quit_on_quiesce(self, num):
"Tell the daemon to quit when it next goes quiescent."
if self.__get_control_socket():
- self.sock.sendall("$%d\r\n" % num)
+ self.sock.sendall("$%d\r\n\x00" % num)
self.sock.recv(12)
self.sock.close()
def kill(self):