From owner-freebsd-hackers Fri May 7 17:30:45 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 9E82714C47 for ; Fri, 7 May 1999 17:30:40 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id KAA04671; Sat, 8 May 1999 10:00:38 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id KAA52667; Sat, 8 May 1999 10:00:37 +0930 (CST) Date: Sat, 8 May 1999 10:00:37 +0930 From: Greg Lehey To: Ludo Koren Cc: freebsd-hackers@FreeBSD.ORG Subject: ncurses problems (was: no subject) Message-ID: <19990508100037.F50800@freebie.lemis.com> References: <199905071646.SAA32811@t15.tempest.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199905071646.SAA32811@t15.tempest.sk>; from Ludo Koren on Fri, May 07, 1999 at 06:46:13PM +0200 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Friday, 7 May 1999 at 18:46:13 +0200, Ludo Koren wrote: > > Hi. > > I am running 3.1-STABLE and developing a program which uses > ncurses. After localization of the problem, I minimized it to the > following: > > #include > #include > #include > > > int main() > { > struct sigaction act; > > act.sa_handler = SIG_IGN; > act.sa_flags = 0; > sigemptyset(&act.sa_mask); > sigaction(SIGINT,&act,0); > > sigaction(SIGINT,0,&act); > printf("%d\n", act.sa_handler == SIG_IGN); > > initscr(); > > sigaction(SIGINT,0,&act); > printf("%d\n", act.sa_handler == SIG_IGN); > > return 0; > } You've missed out an important part: which library are you using? This is what I get: $ cc -g -Wall bar.c -o bar -lcurses $ ./bar 1 1 $ cc -g -Wall bar.c -o bar -lncurses $ ./bar 1 0 > Could somebody point, why the first output is 1 and the second is 0? > Is it bug or feature. It looks like ncurses is setting its own SIGINT handler. I suppose you could think of this as a feature. Does it worry you? Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message