summaryrefslogtreecommitdiff
path: root/libpipe/pipe.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-01 18:26:27 +0000
committerMiles Bader <miles@gnu.org>1995-08-01 18:26:27 +0000
commit869566e876e318462915dcea66bcc1393bead22a (patch)
tree809fb2e68e959a53de0f45931eee954f6229e5e4 /libpipe/pipe.c
parentd3cd7eb03da9459b7c5528cc9f1b70fc80481ec7 (diff)
(pipe_recv): Get rid of code to deal with getting the source address from the
control packet if there is no data packet, since pipe_write always writes a data packet.
Diffstat (limited to 'libpipe/pipe.c')
-rw-r--r--libpipe/pipe.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index d0035cbb..a81bdcdc 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -203,28 +203,14 @@ pipe_recv (struct pipe *pipe, int noblock, unsigned *flags, void **source,
else if (packet && packet->type == PACKET_TYPE_CONTROL)
/* Read this control packet first, before looking for a data packet. */
{
- void *control_source;
-
if (control != NULL)
packet_read (packet, control, control_len, packet_readable (packet));
if (ports != NULL)
/* Copy out the port rights being sent. */
packet_read_ports (packet, ports, num_ports);
- packet_read_source (packet, &control_source);
-
- packet = pq_next (pq, PACKET_TYPE_DATA, control_source);
-
- /* Control packets should only have a source address if they're not
- followed by a data packet. */
- assert (!!packet == !control_source);
-
- if (!packet)
- if (source)
- /* Since there is no data, say where the control data came from. */
- *source = control_source;
- else
- pipe_dealloc_addr (control_source);
+ packet = pq_next (pq, PACKET_TYPE_DATA, NULL);
+ assert (packet); /* pipe_write always writes a data packet. */
}
else
/* No control data... */
@@ -243,6 +229,7 @@ pipe_recv (struct pipe *pipe, int noblock, unsigned *flags, void **source,
if (source)
packet_read_source (packet, source);
+
err = (*pipe->class->read)(packet, &dq, flags, data, data_len, amount);
if (dq)
pq_dequeue (pq);