[9fans] rc: <{command} and > mess with exit status

2021-06-16 Thread adr via 9fans
; if(grep a <{echo a}) echo true
a
true

;  if(echo a | grep a >/tmp/1) echo true
true

But now:
; if(grep a <{echo a} >/tmp/1) echo true
;

Is this expected?

Regards,
adr.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-M3c9f2f564a2513558ec2e075
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] rc: <{command} and > mess with exit status

2021-06-16 Thread Sigrid Solveig Haflínudóttir
; if(grep a <{echo a}) echo true
a
true
; if(echo a | grep a >/tmp/1) echo true
true
; if(grep a <{echo a} >/tmp/1) echo true
true

9front.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-M46d9b94091a4e687c6134eb0
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: rc: <{command} and > mess with exit status

2021-06-16 Thread Anthony Martin
adr via 9fans <9fans@9fans.net> once said:
> ; if(grep a <{echo a} >/tmp/1) echo true
> ;
>
> Is this expected?

This was fixed a few years ago in 9front:

http://git.9front.org/plan9front/plan9front/2839760066e578e449ebc8b3d71297b9f79a8c99/commit.html

Cheers,
  Anthony

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-M2ee91d7ff496d1af63633dea
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] rc: <{command} and > mess with exit status

2021-06-16 Thread adr via 9fans
Thanks, it looks like a bug.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-Me2445f0e132fd2e7da654a5e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] the #cat-v channel has moved to oftc

2021-06-16 Thread Ethan Gardener
On Tue, Jun 15, 2021, at 10:56 AM, hiro wrote:
> freenode has deleted all channel and user accounts, including the
> #cat-v IRC channel.

I'm very sorry to hear about this. Freenode was a big part of my life for about 
10 years.

> we had already abandoned ship and moved to the oftc network instead,
> but now the /topic redirecting users to oftc got deleted.
> 
> our websites, the caches, the search indexes still reference freenode
> in many places, so i hope you can excuse this message to related
> groups to inform you that whatever happens on freenode, it is not us
> any more.
> 
> the people from #cat-v includes the (dp9ik) dissident plan9 irc kids,
> or more recently just the 9front community.
> 
> for some of us this is a sentimental moment as we had to also abandon
> uriel's IRC memorial. but maybe he would stay with us in other ways
> not involving silly computer protocols...

He absolutely will. I've never forgotten Uriel although I haven't been in 
#cat-v for years.

> uriel's nickserv password on freenode was "shitnode".
> 
> have a great day,
> hiro

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T443bc8b8132dd026-Ma3ca6c906986629a5c73ed21
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] 9legacy patches dependency & future releases

2021-06-16 Thread adr via 9fans
Hello,

I was importing rc-line-split.diff from 9legacy and I realized that
it is applied after rc-badrunes.diff.

How are the dependencies of the patches noticed?

Also I saw in https://plan9foundation.org

"The sources for the Plan 9 operating system can be found at
p9f.org/dl where new releases will be maintained into the future."

I would preffer to wait to send diffs if there is going to be an
active repository (I mean a tradicional one, no a patch queue) in
the future.

Regards,
adr.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T1d655e15673a9e4c-M8c9687f46c53955edf007450
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] 9legacy patches dependency & future releases

2021-06-16 Thread David du Colombier
> I was importing rc-line-split.diff from 9legacy and I realized that
> it is applied after rc-badrunes.diff.
> 
> How are the dependencies of the patches noticed?

The patches apply in order. Some are independent,
but some are depending on other patches.

-- 
David du Colombier

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T1d655e15673a9e4c-M82c744c99e95964deb259c6d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] rc: <{command} and > mess with exit status

2021-06-16 Thread ori
Quoth adr via 9fans <9fans@9fans.net>:
> ; if(grep a <{echo a}) echo true
> a
> true
> 
> ;  if(echo a | grep a >/tmp/1) echo true
> true
> 
> But now:
> ; if(grep a <{echo a} >/tmp/1) echo true
> ;
> 
> Is this expected?

It's been fixed. Here's the patch:

From 2839760066e578e449ebc8b3d71297b9f79a8c99
From: cinap_lenrek 
Date: Sat, 08 Sep 2018 12:49:00 +
Subject: [PATCH] rc: fix Xpipefd unbalancing the redir stack


Xpipefd wants the pipe descriptor to be closed in turfredir(), so
it pushes the redirection, but this breaks Xpopredir after normal
redirection. so we shuffle the Xpipefd redir to the bottom of the
stack.
---
diff 217e8a06198cf6681fb0c38c26f34d96ae4302f6 
2839760066e578e449ebc8b3d71297b9f79a8c99
--- a/sys/src/cmd/rc/exec.c Mon Sep  3 16:37:45 2018
+++ b/sys/src/cmd/rc/exec.c Sat Sep  8 08:49:00 2018
@@ -123,6 +123,21 @@
runq->redir = rp;
 }
 
+void
+shuffleredir(void)
+{
+   redir **rr, *rp;
+
+   rp = runq->redir;
+   if(rp==0)
+   return;
+   runq->redir = rp->next;
+   rp->next = runq->startredir;
+   for(rr = &runq->redir; *rr != rp->next; rr = &((*rr)->next))
+   ;
+   *rr = rp;
+}
+
 var*
 newvar(char *name, var *next)
 {
--- a/sys/src/cmd/rc/fns.h  Mon Sep  3 16:37:45 2018
+++ b/sys/src/cmd/rc/fns.h  Sat Sep  8 08:49:00 2018
@@ -55,6 +55,7 @@
 word*  searchpath(char*);
 void   setstatus(char*);
 void   setvar(char*, word*);
+void   shuffleredir(void);
 void   skipnl(void);
 void   start(code*, int, var*);
 inttruestatus(void);
--- a/sys/src/cmd/rc/havefork.c Mon Sep  3 16:37:45 2018
+++ b/sys/src/cmd/rc/havefork.c Sat Sep  8 08:49:00 2018
@@ -185,7 +185,8 @@
default:
addwaitpid(pid);
close(sidefd);
-   pushredir(ROPEN, mainfd, mainfd);   /* isn't this a noop? */
+   pushredir(ROPEN, mainfd, mainfd);
+   shuffleredir(); /* shuffle redir to bottom of stack for 
turfredir() */
strcpy(name, Fdprefix);
inttoascii(name+strlen(name), mainfd);
pushword(name);
@{
bind -ac /dist/plan9front/ /
git/export 2839760066e578e449ebc8b3d71297b9f79a8c99
}

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-M3410604626038f5a31ffaf9f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Why is there no simple equivelent to plan9's pipes on linux?

2021-06-16 Thread Claude Noël
Plan 9 pipes:
- can be opened by multiple proccesses
- preserve write boundries
- will cache a single write
- 2 way
- simple to use

There's not really anything on linux that really compares to this.
Is there any reason for this? 
Only thing I can think of is plan9 using 2 files per pipe.

--
binarycat




--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T127c618288a5cd57-M838fb86383ccc6455ba4503c
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] rc: <{command} and > mess with exit status

2021-06-16 Thread adr via 9fans
Thanks for the patch!

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tad6cf6b7414c1847-Ma7401221faeb5647bc8bec13
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] 9legacy patches dependency & future releases

2021-06-16 Thread adr via 9fans
On Wed, Jun 16, 2021 at 03:55:07PM +0200, David du Colombier wrote:
> > I was importing rc-line-split.diff from 9legacy and I realized that
> > it is applied after rc-badrunes.diff.
> > 
> > How are the dependencies of the patches noticed?
> 
> The patches apply in order. Some are independent,
> but some are depending on other patches.

I see, then is more easy than I thought. I was going to ask you if
you wanted to include the rc patch sent to the list from 9front,
but I saw just now that is already there, that was fast! 

Regards,
adr.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T1d655e15673a9e4c-Mfd82250ab6636baede6beb2f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] non-interruptible temporary: why do we care?

2021-06-16 Thread unobe
Quoth o...@eigenstate.org:
> Our compilers will sometimes produce a warning about
> a non-interruptible temporary:
> ...
> Why do we warn about non-interruptible
> temporaries? What issues am I missing?

Silence to this question means no one knows, right?


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdcfb8f84c90eb199-Ma99496ee99351822b7971771
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] non-interruptible temporary: why do we care?

2021-06-16 Thread ori
Quoth un...@cpan.org:
> Quoth o...@eigenstate.org:
> > Our compilers will sometimes produce a warning about
> > a non-interruptible temporary:
> > ...
> > Why do we warn about non-interruptible
> > temporaries? What issues am I missing?
> 
> Silence to this question means no one knows, right?
> 

I pinged Charles off list and got a response -- it means
we're falling into the rathole; in other words, we're
accessing a global variable.

The right thing to do (IMO) is make the compiler allocate
on the stack, and then the warning would be unneded.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdcfb8f84c90eb199-Ma608800db7356d10a02c4b44
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] 9legacy patches dependency & future releases

2021-06-16 Thread David du Colombier
> I see, then is more easy than I thought. I was going to ask you if
> you wanted to include the rc patch sent to the list from 9front,
> but I saw just now that is already there, that was fast! 

Yes, I saw the patch in the other thread, so I've added it.

-- 
David du Colombier

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T1d655e15673a9e4c-M1ca73db684e89203163a7c3a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] non-interruptible temporary: why do we care?

2021-06-16 Thread Anthony Martin
un...@cpan.org once said:
> Quoth o...@eigenstate.org:
> > Why do we warn about non-interruptible
> > temporaries? What issues am I missing?
>
> Silence to this question means no one knows, right?

There is nothing new under the sun.

Date: Mon, 4 Apr 2005 14:10:20 -0400
From: Russ Cox 
To: Fans of the OS Plan 9 from Bell Labs <9f...@cse.psu.edu>
Subject: Re: [9fans] 'non-interruptable temporary' warning
Message-ID: 

the compiler is warning you against its own laziness.
in this case it is using a global temporary to hold the
intermediate value of (lba = f->lba) while converting
it to uchar.  if you had another thread running through
this code it would use the same temporary.

[...]

Cheers,
  Anthony

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdcfb8f84c90eb199-Ma5f11ad84f13cd81ba0c8c85
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] non-interruptible temporary: why do we care?

2021-06-16 Thread unobe
Quoth Anthony Martin :
> There is nothing new under the sun.
> 
> Date: Mon, 4 Apr 2005 14:10:20 -0400
> From: Russ Cox 
> To: Fans of the OS Plan 9 from Bell Labs <9f...@cse.psu.edu>
> Subject: Re: [9fans] 'non-interruptable temporary' warning
> Message-ID: 
> 
> the compiler is warning you against its own laziness.
> in this case it is using a global temporary to hold the
> intermediate value of (lba = f->lba) while converting
> it to uchar.  if you had another thread running through
> this code it would use the same temporary.
> 
> [...]
> 
> Cheers,
>   Anthony

Thanks for the quotation, Anthony.  I had used
9fans.topicbox.com/groups/9fans to search 'non-interruptible', not
'non-interruptable': I should have searched the actual error.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdcfb8f84c90eb199-M69e2bbedbc7f9cc31ede7ec0
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription