diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-02-15 20:46:12 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-02-15 20:48:16 +0100 |
commit | d0716c74b5fa2aead849fc4132a0f7fdfce02575 (patch) | |
tree | c09135d8a9ad9cf6efe1a20e56d913efb53d9b7b /trans | |
parent | 0788437e0953cdd6c8c4cdf25379d8704beb021c (diff) |
Make fakeroot forward send errors instead of crashing
* trans/fakeroot.c (netfs_demuxer): When forwarding an unknown request fail,
forward the error instead of crashing.
Diffstat (limited to 'trans')
-rw-r--r-- | trans/fakeroot.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 64f32081..cb4f818d 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -1032,10 +1032,12 @@ netfs_demuxer (mach_msg_header_t *inp, err = mach_msg (inp, MACH_SEND_MSG, inp->msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - assert_perror (err); /* XXX should synthesize reply */ + if (err) + ((mig_reply_header_t *) outp)->RetCode = err; + else + /* We already sent the message, so the server loop shouldn't do it again. */ + ((mig_reply_header_t *) outp)->RetCode = MIG_NO_REPLY; ports_port_deref (cred); - /* We already sent the message, so the server loop shouldn't do it again. */ - ((mig_reply_header_t *) outp)->RetCode = MIG_NO_REPLY; return 1; } } |