summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Farnsworth <simon.farnsworth@onelan.co.uk>2015-03-25 17:00:09 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:22 -0400
commitd6c4257815a7d231aa55d4fa88d6cb374d98c3e8 (patch)
treedb1550348c39bf9d8dc0cd95e90378ca1065e5a5
parent7ea37c0d40bb23e44777925207dd4338037861f7 (diff)
downloadpython-systemd-d6c4257815a7d231aa55d4fa88d6cb374d98c3e8.tar.gz
python-systemd: fix is_socket_inet to cope with ports
Just a couple of trivial oversights.
-rw-r--r--systemd/_daemon.c2
-rw-r--r--systemd/daemon.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/systemd/_daemon.c b/systemd/_daemon.c
index 65cfec7..7c5f1b2 100644
--- a/systemd/_daemon.c
+++ b/systemd/_daemon.c
@@ -225,7 +225,7 @@ static PyObject* is_socket_inet(PyObject *self, PyObject *args) {
&fd, &family, &type, &listening, &port))
return NULL;
- if (port < 0 || port > INT16_MAX) {
+ if (port < 0 || port > UINT16_MAX) {
set_error(-EINVAL, NULL, "port must fit into uint16_t");
return NULL;
}
diff --git a/systemd/daemon.py b/systemd/daemon.py
index 1c386bb..82011ca 100644
--- a/systemd/daemon.py
+++ b/systemd/daemon.py
@@ -26,7 +26,7 @@ def is_socket(fileobj, family=_AF_UNSPEC, type=0, listening=-1):
def is_socket_inet(fileobj, family=_AF_UNSPEC, type=0, listening=-1, port=0):
fd = _convert_fileobj(fileobj)
- return _is_socket_inet(fd, family, type, listening)
+ return _is_socket_inet(fd, family, type, listening, port)
def is_socket_unix(fileobj, type=0, listening=-1, path=None):
fd = _convert_fileobj(fileobj)