From 7b5db1c35abac2240fffbee2027c3e99b760863c Mon Sep 17 00:00:00 2001 From: Mathieu Lonjaret Date: Sat, 12 Sep 2009 15:25:51 -0400 Subject: libplumb, Mail: fix crash on nil plumb fids http://codereview.appspot.com/116083 --- src/cmd/acme/mail/mail.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/cmd/acme') diff --git a/src/cmd/acme/mail/mail.c b/src/cmd/acme/mail/mail.c index 14ace323..474d8497 100644 --- a/src/cmd/acme/mail/mail.c +++ b/src/cmd/acme/mail/mail.c @@ -84,9 +84,12 @@ threadmain(int argc, char *argv[]) quotefmtinstall(); /* open these early so we won't miss notification of new mail messages while we read mbox */ - plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC); - plumbseemailfd = plumbopenfid("seemail", OREAD|OCEXEC); - plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC); + if((plumbsendfd = plumbopenfid("send", OWRITE|OCEXEC)) == nil) + fprint(2, "warning: open plumb/send: %r\n"); + if((plumbseemailfd = plumbopenfid("seemail", OREAD|OCEXEC)) == nil) + fprint(2, "warning: open plumb/seemail: %r\n"); + if((plumbshowmailfd = plumbopenfid("showmail", OREAD|OCEXEC)) == nil) + fprint(2, "warning: open plumb/showmail: %r\n"); shortmenu = 0; srvname = "mail"; -- cgit v1.2.3