From: sirjofri <sirjofri+ml-9front@sirjofri.de>
To: 9front@9front.org
Subject: Re: [9front] [Patch] Mail fails to send attachments
Date: Sat, 20 Feb 2021 14:35:00 +0000 (UTC) [thread overview]
Message-ID: <01ab3877-daa6-44a1-a943-7aefdb4de958@sirjofri.de> (raw)
Somehow this mail wasn't sent. Here it is:
20.02.2021 14:29:59 joel@sirjofri.de:
Quoth sirjofri <sirjofri+ml-9front@sirjofri.de>:
> We should still check the returned file descriptor, just in case the
> user has no mailbox directory.
This patch includes that check.
I adjusted the tee function so that the second destination is ignored
if it's invalid.
sirjofri
.
diff -r 297026d9dc30 sys/src/cmd/upas/marshal/marshal.c
--- a/sys/src/cmd/upas/marshal/marshal.c Thu Feb 18 21:40:30 2021 +0100
+++ b/sys/src/cmd/upas/marshal/marshal.c Sat Feb 20 14:27:35 2021 +0100
@@ -985,10 +985,12 @@
int n;
char buf[8*1024];
- while ((n = read(in, buf, sizeof buf)) > 0)
- if (write(out1, buf, n) != n ||
- write(out2, buf, n) != n)
+ while ((n = read(in, buf, sizeof buf)) > 0){
+ if (write(out1, buf, n) != n)
break;
+ if (out2 >= 0 && write(out2, buf, n) != n)
+ break;
+ }
}
/* print the unix from line */
@@ -1086,11 +1088,14 @@
case 0:
close(pfd[0]);
/* BOTCH; "From " time gets changed */
- b = openfolder(foldername(nil, user, rcvr), time(0));
- fd = b? Bfildes(b): -1;
- printunixfrom(fd);
- tee(0, pfd[1], fd);
- write(fd, "\n", 1);
+ b = openfolder(foldername(nil, login, rcvr), time(0));
+ if (b){
+ fd = Bfildes(b);
+ printunixfrom(fd);
+ tee(0, pfd[1], fd);
+ write(fd, "\n", 1);
+ } else
+ tee(0, pfd[1], -1);
closefolder(b);
exits(0);
default:
next reply other threads:[~2021-02-20 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-20 14:35 sirjofri [this message]
2021-02-20 21:02 ` ori
-- strict thread matches above, loose matches on Subject: below --
2021-02-19 23:27 [9front] [Bug] " ori
2021-02-20 13:16 ` [9front] [Patch] " sirjofri
2021-02-20 13:37 ` hiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01ab3877-daa6-44a1-a943-7aefdb4de958@sirjofri.de \
--to=sirjofri+ml-9front@sirjofri.de \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).