summaryrefslogtreecommitdiff
path: root/libports
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-08 23:00:27 +0000
committerMiles Bader <miles@gnu.org>1995-07-08 23:00:27 +0000
commitd9e968ebea1593d4621fb9c7b6058021f22340c5 (patch)
tree431a955fd010a2da453feaeecbd32e05fb2597f4 /libports
parent52e99c5b8584574e59f09a133b4a82db655c46f1 (diff)
(ports_allocate_port): Properly add PI to CLASS's port list when the
list is empty.
Diffstat (limited to 'libports')
-rw-r--r--libports/allocate-port.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libports/allocate-port.c b/libports/allocate-port.c
index 03839635..d3581db0 100644
--- a/libports/allocate-port.c
+++ b/libports/allocate-port.c
@@ -68,7 +68,8 @@ void *ports_allocate_port (struct port_bucket *bucket,
assert_perror (err);
pi->next = class->ports;
pi->prevp = &class->ports;
- class->ports->prevp = &pi->next;
+ if (class->ports)
+ class->ports->prevp = &pi->next;
class->ports = pi;
bucket->count++;
class->count++;