diff options
Diffstat (limited to 'libpipe/dgram.c')
-rw-r--r-- | libpipe/dgram.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libpipe/dgram.c b/libpipe/dgram.c index 3f3b2ab6..30695f1e 100644 --- a/libpipe/dgram.c +++ b/libpipe/dgram.c @@ -40,8 +40,16 @@ static error_t dgram_read (struct packet *packet, int *dequeue, unsigned *flags, char **data, size_t *data_len, size_t amount) { - *dequeue = 1; - return packet_read (packet, data, data_len, amount); + if (flags && *flags & MSG_PEEK) + { + *dequeue = 0; + return packet_peek (packet, data, data_len, amount); + } + else + { + *dequeue = 1; + return packet_read (packet, data, data_len, amount); + } } struct pipe_class _dgram_pipe_class = |