From b555ab78b18822af9e1b491c4bb7775a02b2c2ab Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Mon, 23 Jan 2012 12:39:24 -0600 Subject: replace enable external editor with enable signals --- externaleditor.c | 3 ++- xxxterm.c | 9 +++++++-- xxxterm.h | 6 ++---- 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 #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 #endif -- cgit 1.4.1-2-gfad0