Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!munnari.oz.au!labtam!john From: john@labtam.oz (John Carey) Newsgroups: comp.windows.x Subject: twm handles signals incorrectlt +FIX Message-ID: <4407@labtam.oz> Date: 7 May 90 23:03:25 GMT Organization: Labtam Limited., Melbourne, Australia Lines: 64 Sent to mit X Window System Bug Report xbugs@expo.lcs.mit.edu VERSION: R4 CLIENT MACHINE and OPERATING SYSTEM: Labtam Delta/386 running System V Release 3.2 DISPLAY TYPE: Labtam Xengine (all models) WINDOW MANAGER: twm AREA: twm SYNOPSIS: twm handles signals incorrectly +FIX DESCRIPTION: twm catches SIGQUIT when running in the background. The code setting the signals should check if the SIGQUIT is SIG_IGN before setting the new handler. REPEAT BY: twm & # start twm in the background ^\ # then hit QUIT character twm then exits SAMPLE FIX: Here is the patch -------------------------------------------------------------------------------- *** twm.c_old Mon May 7 17:05:12 1990 --- twm.c Mon May 7 17:04:03 1990 *************** *** 179,186 **** if (old_handler != SIG_IGN) signal(SIGHUP, Done); ! signal(SIGQUIT, Done); ! signal(SIGTERM, Done); Home = getenv("HOME"); if (Home == NULL) --- 179,191 ---- if (old_handler != SIG_IGN) signal(SIGHUP, Done); ! old_handler = signal(SIGQUIT, SIG_IGN); ! if (old_handler != SIG_IGN) ! signal(SIGQUIT, Done); ! ! old_handler = signal(SIGTERM, SIG_IGN); ! if (old_handler != SIG_IGN) ! signal(SIGTERM, Done); Home = getenv("HOME"); if (Home == NULL)