Commit graph

34 commits

Author SHA1 Message Date
Russ Cox
b3a20a96eb libthread: add threadmaybackground
Programs that want to background themselves now need
to define threadmaybackground returning 1.
This avoids a confusing (to people and debuggers)
extra parent process for all the threaded programs
that will never want to background themselves.
2020-12-30 00:12:14 -05:00
Dan Cross
fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00
Jason Felice
b0aecb4ba5 plumber: add -f (foreground) option (#288)
In MacOS, services run by launchd must run in the foreground, since
launchd manages forking and other resources.
2019-10-29 10:07:10 -04:00
Fazlul Shahriar
b9424f640a plumber: fix EOF detection on writes to rules file (#257)
Instead of checking Fcall.data==nil, check Fcall.count==0.
The former check always fails after `gcc -O2` optimizations
(gcc version 8.3.0).

Also fix an out-of-bound read detected by valgrind:
```
==31162== Invalid read of size 1
==31162==    at 0x11005E: morerules (rules.c:739)
==31162==    by 0x110254: writerules (rules.c:775)
==31162==    by 0x10D2FE: fsyswrite (fsys.c:848)
==31162==    by 0x10C304: fsysproc (fsys.c:248)
==31162==    by 0x112E8C: threadstart (thread.c:96)
==31162==    by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so)
==31162==  Address 0x4ea984a is 0 bytes after a block of size 250 alloc'd
==31162==    at 0x483AD7B: realloc (vg_replace_malloc.c:826)
==31162==    by 0x1196F3: p9realloc (malloc.c:53)
==31162==    by 0x10BDFD: erealloc (plumber.c:124)
==31162==    by 0x10FCD9: concat (rules.c:642)
==31162==    by 0x10FCD9: concat (rules.c:635)
==31162==    by 0x110230: writerules (rules.c:773)
==31162==    by 0x10D2FE: fsyswrite (fsys.c:848)
==31162==    by 0x10C304: fsysproc (fsys.c:248)
==31162==    by 0x112E8C: threadstart (thread.c:96)
==31162==    by 0x4A682BF: ??? (in /usr/lib/libc-2.29.so)
```

Fixes #256
2019-09-19 13:08:54 -04:00
Russ Cox
c149b06f2e plumb: remove debugging print
R=rsc
http://codereview.appspot.com/6210059
2012-05-15 10:55:53 -04:00
Russ Cox
a6ba36b663 plumber: comment out bogus user name check
R=rsc
http://codereview.appspot.com/2295043
2010-10-07 03:31:19 -04:00
Russ Cox
7db5826d1b post9pservice: add extra arg to unmodified calls 2008-04-17 16:13:04 -04:00
rsc
cbeb0b26e4 Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
rsc
3bd56b04a8 NetBSD-macppc ctype needs uchars. 2005-09-09 23:16:15 +00:00
rsc
ca30274bd9 add -9 for debugging 2005-03-18 19:02:55 +00:00
rsc
c8b6342d3c Many small edits. 2005-01-13 04:49:19 +00:00
rsc
4de03b544c add $plan9 variable 2005-01-11 19:46:06 +00:00
rsc
f4b26b64bc do threading right 2005-01-04 22:17:10 +00:00
rsc
b10db40d3b exit correctly 2005-01-04 22:17:00 +00:00
rsc
372e9667df Goodbye SHORTLIB 2005-01-04 22:10:29 +00:00
rsc
df49b30343 be like plan 9 plumber 2004-12-28 23:20:54 +00:00
rsc
07bda1263e avoid use of an extra proc 2004-12-28 22:29:43 +00:00
rsc
f7b74c1725 FreeBSD tweaks 2004-12-28 17:34:05 +00:00
rsc
7ffc5208a8 use threaddaemonize 2004-12-28 01:37:18 +00:00
rsc
f99790979b update to use new thread library 2004-12-26 02:10:47 +00:00
wkj
a87638642c Compare function pointers against 0 rather than nil. 2004-07-09 01:54:06 +00:00
rsc
1b135a7805 clean up when finished.
don't set PLAN9
don't set PLAN9
2004-04-19 23:04:36 +00:00
rsc
be22ae2d07 SunOS can rot in hell. 2004-03-26 01:59:35 +00:00
rsc
8ad517944e Today's changes.
More changes.
2004-03-25 23:03:57 +00:00
rsc
2277c5d7bb Small tweaks
Lots of new code imported.
2004-03-21 04:33:13 +00:00
rsc
15680d56a6 Amazingly picky bug fixes from Valgrind. 2004-03-05 05:53:11 +00:00
rsc
4da83e7cce Various little fixes. 2004-03-05 03:13:13 +00:00
rsc
c91bd3283a Pipes cannot use SOCK_DGRAM. Back to SOCK_STREAM.
Add debugging to fdwait.

Rewrite getcallerpc on PowerMac to be correct.
2004-03-05 02:25:41 +00:00
rsc
d21d62e2fc Various tweaks. 2004-02-29 23:20:28 +00:00
rsc
f063dad96e Small tweaks to make things build again. 2004-02-29 22:42:33 +00:00
rsc
32f69c36e0 Add support for user-level 9P servers/clients and various bug fixes to go with them. 2003-12-11 17:48:38 +00:00
rsc
9e37bb03b3 make -> mk 2003-11-23 18:23:38 +00:00
rsc
b8c14089d8 Plan 9 version, nothing tweaked yet. 2003-11-23 17:58:26 +00:00
rsc
3d7e9092a4 Single-threaded plumber that can run "start" rules.
Thanks to Caerwyn Jones.
2003-10-14 02:35:00 +00:00