Subject: Re: [pkg/26351] Re: CVS commit: src/usr.bin/ftp
To: Ognyan Kulev <ogi@fmi.uni-sofia.bg>
From: Luke Mewburn <lukem@NetBSD.org>
List: source-changes
Date: 07/21/2004 10:17:45
--0786ZyFfTSxuegBe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Jul 20, 2004 at 04:28:26PM +0300, Ognyan Kulev wrote:
| (All my tests are on Debian GNU/Linux testing.)
|=20
| I've applied these diffs to bootstrap, ftp returns exit code 130 when=
=20
| it's interrupted, but shell continues to loop. So exit code greater=20
| than 128 is not enough alone.
|=20
| So when SIGINT is received, the only correct way to handle it is to set=
=20
| SIGINT to SIG_DFL and raise SIGINT. Patch is attached that do this and=
=20
| that works. (I'm not sure if sigaction should be used.)
Thanks. I've reworked ftp to use this method (although not exactly
the same code).
| And there is one more question: is SIGINT enough? Looking at list of=
=20
| signals[1], those that terminate process (without core dump) and are=20
| usually issued by user are SIGHUP, SIGINT and SIGTERM. I think all=20
| these should be handled this way.
ftp(1) doesn't have a specific handler for SIGHUP or SIGTERM,
and the editline EL_SIGNAL stuff appears to use the "default"
handler after doing it's own thing.
Unless bash needs the non zero exit code _and_ the WIFSIGNALED()
result to break out of the while loop ?
--0786ZyFfTSxuegBe
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)
iD8DBQFA/bYppBhtmn8zJHIRAvdxAJ0fnZNiMCUTt/b6EX25R0jCxyzdRgCfXSpn
8EAjTAeBV30rYXCv0hHtQlA=
=IWdg
-----END PGP SIGNATURE-----
--0786ZyFfTSxuegBe--