shithub: mc

Download patch

ref: f97eb726adadbde0e2d855b8b59f4f84f403d491
parent: 3d9ce334368f0d6e7da472200c68c7081889058b
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Nov 21 07:45:49 EST 2016

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.

--- 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
--- /dev/null
+++ b/lib/sys/setup+posixy.myr
@@ -1,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)
+}