summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-02-22 01:57:01 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-02-22 01:57:01 +0100
commit8fb38008cc0abccdce7b8a971bf0c3f1745655b8 (patch)
tree65a82bc6117efbd661d7f103e5a4455c87ada668
parent0cbb8c0650eacae336687243904048a0d22233a2 (diff)
Fix S_pfinet_siocgifconf given -1 as amount
* hurd/pfinet.defs (pfinet_siocgifconf): Document that -1 is used for "all interfaces". * pfinet/pfinet-ops.c (S_pfinet_siocgifconf): Compare amount with `(vm_size_t) -1' instead of '< 0' (which can never happen).
-rw-r--r--hurd/pfinet.defs2
-rw-r--r--pfinet/pfinet-ops.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hurd/pfinet.defs b/hurd/pfinet.defs
index a42b6d0c..ec0b03e3 100644
--- a/hurd/pfinet.defs
+++ b/hurd/pfinet.defs
@@ -29,7 +29,7 @@ INTR_INTERFACE
/* Return a list of interfaces as expected by the SIOCGIFCONF ioctl.
The maximum number of bytes returned can be given in AMOUNT, but if
- AMOUNT is negative, all interfaces will be returned. Always
+ AMOUNT is -1, all interfaces will be returned. Always
succeeds (and interface list will be truncated to fit into AMOUNT
space) for BSD compatibility. */
routine pfinet_siocgifconf (
diff --git a/pfinet/pfinet-ops.c b/pfinet/pfinet-ops.c
index a61028ef..8e251020 100644
--- a/pfinet/pfinet-ops.c
+++ b/pfinet/pfinet-ops.c
@@ -49,7 +49,7 @@ S_pfinet_siocgifconf (io_t port,
struct ifconf ifc;
__mutex_lock (&global_lock);
- if (amount < 0)
+ if (amount == (vm_size_t) -1)
{
/* Get the needed buffer length. */
ifc.ifc_buf = NULL;