diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-02-04 01:10:40 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-02-04 01:10:40 +0100 |
commit | 4cf6eebf94d50cd62e9bbbaedd4ece699838ed75 (patch) | |
tree | 4e3656462bb617c65c8eec8663a0fdd771fa48e7 | |
parent | 57364827bc81e74d96fedbbd7fc78cf2d3ad382d (diff) | |
download | hurd-4cf6eebf94d50cd62e9bbbaedd4ece699838ed75.tar.gz hurd-4cf6eebf94d50cd62e9bbbaedd4ece699838ed75.tar.bz2 hurd-4cf6eebf94d50cd62e9bbbaedd4ece699838ed75.zip |
libpipe: crash verbosely if mmap was to fail
-rw-r--r-- | libpipe/pq.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpipe/pq.c b/libpipe/pq.c index fff03e67..069b41bc 100644 --- a/libpipe/pq.c +++ b/libpipe/pq.c @@ -410,7 +410,13 @@ packet_fetch (struct packet *packet, /* Just copy the data the old fashioned way.... */ { if (*data_len < amount) - *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + { + *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + if (*data == MAP_FAILED) + assert_perror_backtrace (errno); + else + assert_backtrace (*data); + } memcpy (*data, start, amount); start += amount; |