From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id e83ddfdf for ; Tue, 11 Feb 2020 10:03:36 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 354CA9BD07; Tue, 11 Feb 2020 20:03:35 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EFE499BCE3; Tue, 11 Feb 2020 20:03:21 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JuDaP9m6"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 1D4949BCE3; Tue, 11 Feb 2020 20:03:21 +1000 (AEST) Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) by minnie.tuhs.org (Postfix) with ESMTPS id 9E6429BCDE for ; Tue, 11 Feb 2020 20:03:20 +1000 (AEST) Received: by mail-ua1-f47.google.com with SMTP id y3so3719867uae.3 for ; Tue, 11 Feb 2020 02:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qr6LmuN4mQKjRa4YtxWCA9QMnOvF78dHLvuRv2e6ta4=; b=JuDaP9m6SIbBBvc0ArKj3mYMebOUoBDUmitoaoYIZn+ej68A1OFEPjhnw8fh4ZPqLN jIj7Myx4xR1Uz+kAki+inenZ35Z4TDmEZO5PZt/7z3iuJS9mUt6/wBS2eenrjwEDeO41 mSq9hAwXpa4nZujgd5NX/xdAVFRNMzuKHNbmOW2A/OmjDoOiqujWHegif/qpq2mRIJrN HPgKeom1dijvcOU8fCk1Fs498zQ8yEU5xuBZXIKeQYspu6zp46OlnD5KEuG9KzU8s23s YpgHe/eRq0HGX71M/BcIFet38aV0s99odXxi8DJ3+pnIEWIDjMJ3Deh3vinVrD1wJdQt qN5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qr6LmuN4mQKjRa4YtxWCA9QMnOvF78dHLvuRv2e6ta4=; b=jLmWRICSdUs9Z33vyuKzQphHIVDOWGiL4fOs7Ept3OCsC9z1mZnDsC5rCBrK+5xecP JfHYD2RMgY5D5CJNb8Ch/sOmcNwfhrBuaJhptyuNDbPfQ5Fp9eEigb0DfRAh6XR3+dD0 P0Cj61g8GTw+cfT9gq7ZVkQH0y4cxGPK8+4XW18K4lr4pEHl+HH8r4LzZnGv3Y/RQWuZ YKgFMb36r6KKofLGM6aI/5f70hYIp/mQxl9BY7bzKXoMV+Ff+z7dJbpjc2PKSp3lTkjA dDKZkISeWBCNGe0KW1vc2hS0ONhqf+oHTtsOjUQwl6in0xR1dd3s6c71L7mjL6HohnTg DPGw== X-Gm-Message-State: APjAAAUMA2kiPqIrUIRJl1kxN6eh7+OeUuxSvuLDxdqx2Vl4JoM1nsqM 1QNkq1El/s6ZnPi4igjcBnyi6AVmTLTy3QvrHXA= X-Google-Smtp-Source: APXvYqycD6PkfzkJlc4bMkPeC/MbqutrnQY289XE36QexC9q5W+uF6M8gVhWa0zgjjNT65LdyW2uY++l+VZdgBN3uAo= X-Received: by 2002:ab0:46c:: with SMTP id 99mr1182814uav.134.1581415399817; Tue, 11 Feb 2020 02:03:19 -0800 (PST) MIME-Version: 1.0 References: <202002110746.01B7kTrT032157@freefriends.org> In-Reply-To: <202002110746.01B7kTrT032157@freefriends.org> From: Rob Pike Date: Tue, 11 Feb 2020 21:03:08 +1100 Message-ID: To: arnold@skeeve.com Content-Type: multipart/alternative; boundary="0000000000002607a4059e49f769" Subject: Re: [TUHS] compiling v9sh X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000002607a4059e49f769 Content-Type: text/plain; charset="UTF-8" Is that version still using the interrupt trick? I can't remember if I ripped that out for (sad) portability reasons. -rob On Tue, Feb 11, 2020 at 6:47 PM wrote: > For anyone who's interested, here is what it took to compile Geoff > Collyer's v9sh on Ubuntu 18.04. > > Arnold > ---------------------------------- > diff -ur v9sh/error.c v9sh-new/error.c > --- v9sh/error.c 2017-07-29 11:45:07.000000000 +0300 > +++ v9sh-new/error.c 2020-02-10 17:31:33.275920947 +0200 > @@ -24,7 +24,7 @@ > } > if (per) { > prs(colon); > - prs(errno < 0 || errno >= sys_nerr? "Bad errno": > sys_errlist[errno]); > + prs(strerror(errno)); > } > newline(); > exitsh(ERROR); > diff -ur v9sh/pathserv.c v9sh-new/pathserv.c > --- v9sh/pathserv.c 2017-07-29 12:06:25.000000000 +0300 > +++ v9sh-new/pathserv.c 2020-02-10 17:29:43.666971083 +0200 > @@ -30,7 +30,7 @@ > { > struct stat buf; > > - if (stat(name, &buf) == 0 && (buf.st_mode&S_IFMT) == S_IFREG && > + if (stat(name, &buf) == 0 && S_ISREG(buf.st_mode) && > access(name, EXECUTE) == 0) > return 0; > else > diff -ur v9sh/xec.c v9sh-new/xec.c > --- v9sh/xec.c 2017-07-29 12:27:02.000000000 +0300 > +++ v9sh-new/xec.c 2020-02-10 17:29:50.607030967 +0200 > @@ -612,7 +612,7 @@ > > if (flags&ttyflg && (dir1 = spname(tempdir, > &score)) && > stat(dir1, &sb) == 0 && > - (sb.st_mode&S_IFMT) == S_IFDIR && > + S_ISDIR(sb.st_mode) && > access(dir1, EXECUTE) == 0) { > /* dir1 is a searchable directory. */ > if (score < bestscore) { > --0000000000002607a4059e49f769 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Is that version still using the interrupt trick? I can'= ;t remember if I ripped that out for (sad) portability reasons.

-rob


On Tue, Feb 11, 2020 at 6:47 PM <arnold@skeeve.com> wrote:
For anyone who's intere= sted, here is what it took to compile Geoff
Collyer's v9sh on Ubuntu 18.04.

Arnold
----------------------------------
diff -ur v9sh/error.c v9sh-new/error.c
--- v9sh/error.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 2017-07-29 11:45:07.000000000 += 0300
+++ v9sh-new/error.c=C2=A0 =C2=A0 2020-02-10 17:31:33.275920947 +0200
@@ -24,7 +24,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (per) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prs(colon);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0prs(errno < 0 ||= errno >=3D sys_nerr? "Bad errno": sys_errlist[errno]);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0prs(strerror(errno)= );
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 newline();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 exitsh(ERROR);
diff -ur v9sh/pathserv.c v9sh-new/pathserv.c
--- v9sh/pathserv.c=C2=A0 =C2=A0 =C2=A02017-07-29 12:06:25.000000000 +0300<= br> +++ v9sh-new/pathserv.c 2020-02-10 17:29:43.666971083 +0200
@@ -30,7 +30,7 @@
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct stat buf;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (stat(name, &buf) =3D=3D 0 && (b= uf.st_mode&S_IFMT) =3D=3D S_IFREG &&
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (stat(name, &buf) =3D=3D 0 && S_= ISREG(buf.st_mode) &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 access(name, EXECUTE) =3D=3D 0) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else
diff -ur v9sh/xec.c v9sh-new/xec.c
--- v9sh/xec.c=C2=A0 2017-07-29 12:27:02.000000000 +0300
+++ v9sh-new/xec.c=C2=A0 =C2=A0 =C2=A0 2020-02-10 17:29:50.607030967 +0200<= br> @@ -612,7 +612,7 @@

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 if (flags&ttyflg && (dir1 =3D spname(tempdir, &s= core)) &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 stat(dir1, &sb) =3D=3D 0 &&
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(sb.st_mode&S_IFMT) =3D=3D S_IFDIR && +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0S_ISDIR(sb.st_mode) &&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 access(dir1, EXECUTE) =3D=3D 0) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* dir1 is a searchable directory. *= /
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (score < bestscore) {
--0000000000002607a4059e49f769--