about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2012-01-23 12:39:24 -0600
committerMarco Peereboom <marco@conformal.com>2012-01-23 12:39:24 -0600
commitb555ab78b18822af9e1b491c4bb7775a02b2c2ab (patch)
treed02595d3fad1f2e432ba4ab903d17e7ff45ca9d8
parent9ceac4af86edd9b59c0e617f1a73f227ded32763 (diff)
downloadxombrero-b555ab78b18822af9e1b491c4bb7775a02b2c2ab.tar.gz
replace enable external editor with enable signals
-rw-r--r--externaleditor.c3
-rw-r--r--xxxterm.c9
-rw-r--r--xxxterm.h6
3 files changed, 11 insertions, 7 deletions
diff --git a/externaleditor.c b/externaleditor.c
index 575e6f8..5c89173 100644
--- a/externaleditor.c
+++ b/externaleditor.c
@@ -16,7 +16,7 @@
 
 #include "xxxterm.h"
 
-#if WEBKIT_CHECK_VERSION(1, 5, 0) && XT_ENABLE_EXTERNAL_EDITOR
+#if !defined(XT_SIGNALS_DISABLE) && (WEBKIT_CHECK_VERSION(1, 5, 0))
 	/* we got the DOM API we need */
 
 struct edit_src_cb_args {
@@ -230,6 +230,7 @@ open_external_editor(struct tab *t, const char *contents, const char *suffix,
 	}
 
 	/* child */
+	/* XXX KILL system PLEASE */
 	rv = system(command);
 
 	_exit(0);
diff --git a/xxxterm.c b/xxxterm.c
index e1e3383..4028ca0 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -398,7 +398,7 @@ marktoindex(char m)
 	return (-1);
 }
 
-
+#ifndef XT_SIGNALS_DISABLE
 void
 sigchild(int sig)
 {
@@ -435,6 +435,7 @@ sigchild(int sig)
 
 	errno = saved_errno;
 }
+#endif
 
 int
 is_g_object_setting(GObject *o, char *str)
@@ -7299,7 +7300,6 @@ main(int argc, char *argv[])
 	char			*cmd = NULL;
 	FILE			*f = NULL;
 	struct karg		a;
-	struct sigaction	sact;
 	GIOChannel		*channel;
 	struct rlimit		rlp;
 
@@ -7395,12 +7395,17 @@ main(int argc, char *argv[])
 
 	xtp_generate_keys();
 
+	/* XXX this hammer is way too big but treat all signaling the same */
+#ifndef XT_SIGNALS_DISABLE
 	/* signals */
+	struct sigaction	sact;
+
 	bzero(&sact, sizeof(sact));
 	sigemptyset(&sact.sa_mask);
 	sact.sa_handler = sigchild;
 	sact.sa_flags = SA_NOCLDSTOP;
 	sigaction(SIGCHLD, &sact, NULL);
+#endif
 
 	/* set download dir */
 	pwd = getpwuid(getuid());
diff --git a/xxxterm.h b/xxxterm.h
index 5a75895..cb30c3e 100644
--- a/xxxterm.h
+++ b/xxxterm.h
@@ -76,10 +76,8 @@ u_int32_t	arc4random_uniform(u_int32_t);
 #include <pthread.h>
 #endif
 
-/* comment if you don't want to use the external editor */
-#define XT_ENABLE_EXTERNAL_EDITOR	(1)
-
-#ifdef XT_ENABLE_EXTERNAL_EDITOR
+/* set if you don't want to use signals */
+#ifndef XT_SIGNALS_DISABLE
 #include <sys/wait.h>
 #endif