From 417a3d26a0dd0ba77565fc8b5c19449a16d7fd48 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 6 Mar 2009 02:41:40 +0000 Subject: [PATCH] add an option to use sig{set,long}jmp and default it to on for linux systems --- generic.h | 1 + netcat.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/generic.h b/generic.h index dc92cf9..0799866 100644 --- a/generic.h +++ b/generic.h @@ -284,6 +284,7 @@ There's a BIG swamp lurking where network code of any sort lives. #undef HAVE_SYSINFO #undef HAVE_SELECT_H #undef HAVE_TTYENT_H +#define HAVE_SIGSETJMP #define HAVE_SOCKLEN_T #endif /* linux */ diff --git a/netcat.c b/netcat.c index cef4fd5..e4194ec 100644 --- a/netcat.c +++ b/netcat.c @@ -102,6 +102,14 @@ #define socklen_t int #endif +#ifdef HAVE_SIGSETJMP +#define jmp_buf sigjmp_buf +#undef setjmp +#define setjmp(buf) sigsetjmp(buf,1) +#undef longjmp +#define longjmp siglongjmp +#endif + struct host_poop { char name[MAXHOSTNAMELEN]; /* dns name */ char addrs[8][24]; /* ascii-format IP addresses */