summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-11-21 12:45:49 -0800
committerOri Bernstein <ori@eigenstate.org>2016-11-21 12:45:49 -0800
commitf97eb726adadbde0e2d855b8b59f4f84f403d491 (patch)
treef4b96ddd0f2c4730293fd7049cd28ce869b1f879
parent3d9ce334368f0d6e7da472200c68c7081889058b (diff)
downloadmc-f97eb726adadbde0e2d855b8b59f4f84f403d491.tar.gz
Disable sigpipe by default on posixy systems.
Do we ever want it? I can't think of a time when it's the right thing by default.
-rw-r--r--lib/sys/bld.sub1
-rw-r--r--lib/sys/setup+posixy.myr16
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/sys/bld.sub b/lib/sys/bld.sub
index a6babf2..cf589de 100644
--- a/lib/sys/bld.sub
+++ b/lib/sys/bld.sub
@@ -1,5 +1,6 @@
lib sys =
systypes.myr
+ setup+posixy.myr
sys+freebsd-x64.myr
sys+linux-x64.myr
diff --git a/lib/sys/setup+posixy.myr b/lib/sys/setup+posixy.myr
new file mode 100644
index 0000000..18a0f23
--- /dev/null
+++ b/lib/sys/setup+posixy.myr
@@ -0,0 +1,16 @@
+use "sys"
+
+pkg sys =
+;;
+
+const __init__ = {
+ var sa, osa
+
+ /* is there ever a time we care about sigpipe? */
+ sa = [
+ .handler = ({;} : byte#),
+ .flags = sys.Sarestart,
+ .mask = [.bits = [0,0,0,0]]
+ ]
+ sys.sigaction(Sigpipe, &sa, &osa)
+}