From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9796 invoked from network); 20 Feb 2021 15:06:42 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 20 Feb 2021 15:06:42 -0000 Received: from oat.nine.sirjofri.de ([5.45.105.127]) by 1ess; Sat Feb 20 10:00:10 -0500 2021 Received: from sirjofri.de ([178.0.65.31]) by oat; Sat Feb 20 15:35:03 +0100 2021 Date: Sat, 20 Feb 2021 14:35:00 +0000 (UTC) From: sirjofri To: 9front@9front.org Message-ID: <01ab3877-daa6-44a1-a943-7aefdb4de958@sirjofri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <01ab3877-daa6-44a1-a943-7aefdb4de958@sirjofri.de> List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: stateless enhancement configuration ActivityPub blockchain cloud pipelining backend Subject: Re: [9front] [Patch] Mail fails to send attachments Reply-To: 9front@9front.org Precedence: bulk Somehow this mail wasn't sent. Here it is: 20.02.2021 14:29:59 joel@sirjofri.de: Quoth sirjofri : > 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=C2=A0 Thu Feb 18 21:40:30 2021 +01= 00 +++ b/sys/src/cmd/upas/marshal/marshal.c=C2=A0 Sat Feb 20 14:27:35 2021 +01= 00 @@ -985,10 +985,12 @@ =C2=A0 int n; =C2=A0 char buf[8*1024]; - while ((n =3D read(in, buf, sizeof buf)) > 0) -=C2=A0=C2=A0 if (write(out1, buf, n) !=3D n || -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write(out2, buf, n) !=3D n) + while ((n =3D read(in, buf, sizeof buf)) > 0){ +=C2=A0=C2=A0 if (write(out1, buf, n) !=3D n) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; +=C2=A0=C2=A0 if (out2 >=3D 0 && write(out2, buf, n) !=3D n) +=C2=A0=C2=A0=C2=A0=C2=A0 break; + } } /* print the unix from line */ @@ -1086,11 +1088,14 @@ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 0: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 close(pfd[0]); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* BOTCH; "From " time gets chan= ged */ -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 b =3D openfolder(foldername(nil, user= , rcvr), time(0)); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fd =3D b? Bfildes(b): -1; -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printunixfrom(fd); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tee(0, pfd[1], fd); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write(fd, "\n", 1); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 b =3D openfolder(foldername(nil, logi= n, rcvr), time(0)); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (b){ +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fd =3D Bfildes(b); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printunixfrom(fd); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tee(0, pfd[1], fd); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write(fd, "\n", 1); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tee(0, pfd[1], -1); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 closefolder(b); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 exits(0); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 default: