9front - general discussion about 9front
 help / color / mirror / Atom feed
* init.c: remove unnecessary if() statement
@ 2020-06-14 23:32 Ali Fardan
  2020-06-15  0:43 ` [9front] " Ali Fardan
  0 siblings, 1 reply; 2+ messages in thread
From: Ali Fardan @ 2020-06-14 23:32 UTC (permalink / raw)
  To: 9front

in rcexec() there's no need to check for if(manual || iscpu) since if 
cmd is nil and service != terminal

/bin/rc will be executed without arguments anyway.

Thoughts?


diff -r 6055167dc76a sys/src/cmd/init.c
--- a/sys/src/cmd/init.c    Mon Jun 15 00:12:57 2020 +0200
+++ b/sys/src/cmd/init.c    Mon Jun 15 02:27:53 2020 +0300
@@ -140,8 +140,6 @@
  {
      if(cmd)
          execl("/bin/rc", "rc", "-c", cmd, nil);
-    else if(manual || iscpu)
-        execl("/bin/rc", "rc", nil);
      else if(strcmp(service, "terminal") == 0)
          execl("/bin/rc", "rc", "-c", ". /rc/bin/termrc; 
home=/usr/$user; cd && . ./lib/profile", nil);
      else



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] init.c: remove unnecessary if() statement
  2020-06-14 23:32 init.c: remove unnecessary if() statement Ali Fardan
@ 2020-06-15  0:43 ` Ali Fardan
  0 siblings, 0 replies; 2+ messages in thread
From: Ali Fardan @ 2020-06-15  0:43 UTC (permalink / raw)
  To: 9front

On 6/15/20 2:32 AM, Ali Fardan wrote:
> Thoughts?


Actually, the code is right, I was a bit distracted and didn't notice it 
was meant

for -m, apologies.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-15  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 23:32 init.c: remove unnecessary if() statement Ali Fardan
2020-06-15  0:43 ` [9front] " Ali Fardan

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).