From nobody Wed May 21 17:47:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b2f5P4HYlz5wGlK; Wed, 21 May 2025 17:47:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b2f5P3cqCz43fN; Wed, 21 May 2025 17:47:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747849657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9pI5IApZ2AuCfb4xNeOMGTd3EobONZmaHXOC8URaOo=; b=ZueCaRKosGAbelrBtXE+nhnZFa60y6d2pAFM5QnLypQHv/pAlWUYy/IcA++8OP5TmBpshV ClplmZXCfprMFmQPjfUtvl4WRFs4lChv9aBlCa3yE9soS0JEosu0f/h+ry5vt/QtPmuAjX 5909+km9Bx38rJFJZDm/9Ah0ZSXr13h5tLH67r0UETHEyrTSqx9o/JeB69jtR9QTUEo6kw aHxlvDmooA5Buff+xRVrvbp93iLhvPy0vuNE07Ar6NUvC65A0Vl7PUS+eV+HwF9yRtf0j6 mCZ5kRB02Yx5p+53GR2CqdN0Q0RWfR8w/Neh6/Di/EuW0qjOZmepKSnSX7I5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747849657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V9pI5IApZ2AuCfb4xNeOMGTd3EobONZmaHXOC8URaOo=; b=S78rgW/JOqqSjLIXMXUhzxmxFzpYfshFkWhh+dV17M9DVEogygdBP5yodEcOvx/gq2pcKX 4e9x2f0JSOL6RFWMJHj6CKOrztTLzTBorYcNKXbHfmT4GXTfLyu4N6YPhBmqPak/AslRvX PzL7qljvRfyIK3x/brrUlFbJs6DSBx35f0HnKD3gbQEyHhA3v0EBsryz8712XMv3aI1B7u y91I7U5Aj0oYWRg4YT0yDEZW4RMqrG4JFBlYu51Jl0f8jBSY5dA9oRUeKSg7tH76NKUT89 tWy8PHbrZ2yEoqAsefyJshe1nTG6AG5VIhoHb81hzIA0SG3h7EhjieOXgmaVhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747849657; a=rsa-sha256; cv=none; b=OKB8g43Qu7sTV+xt7EaDXOZqoNW0D0yYUC5S9orcbY0aI7D0e4Q6pQFhnxxK4TKAfRUdnK ymP46EwyXSnBlV3xXFz+LXZ2u5MMaBZGsVwpmXZC3GaYsZJ69I2Onoq0PP8iRkzwBlZozO ns96jKH8Www2nXRarFrde70vtRJ4WVB8fQmXEuMvXzXm2CcoGFL9AgkOx/LyUQNqKmfLta /DvNPSMeVfJOvfGYmG/V9nYT830kI3zMnYHT80y8F8BkuCZOTg7pIPIbc8/ZWgKPwoiUvf TkGYYxOvlLlFSQlYzRVIe9PAf6GDYIOh05RNyGMOimsh9Z956CvpXiEiNzPWpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b2f5P2dCtzlHX; Wed, 21 May 2025 17:47:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54LHlbc0074931; Wed, 21 May 2025 17:47:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54LHlbNM074928; Wed, 21 May 2025 17:47:37 GMT (envelope-from git) Date: Wed, 21 May 2025 17:47:37 GMT Message-Id: <202505211747.54LHlbNM074928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a7a3eec3fc37 - stable/14 - mail: remove the SIGHUP handler from lex.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7a3eec3fc37044467551a7e2bb00d9a1388f6b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a3eec3fc37044467551a7e2bb00d9a1388f6b7 commit a7a3eec3fc37044467551a7e2bb00d9a1388f6b7 Author: Kyle Evans AuthorDate: 2025-05-14 19:20:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-05-21 17:33:09 +0000 mail: remove the SIGHUP handler from lex.c If the command is simply going to exit without doing any cleanup, then an immediate exit(3) does not add any value and in-fact obscures that the program was terminated by a signal. This is motivated by POSIX conformance requirements, but it's also a little bit of a tidy-up. Some investigation into the history of mail(1) shows that, at one point, hangup() would attempt to save messages into mbox before exiting. It was later transformed into a simple exit() and likely could have been GC'd at that point. Reviewed by: des, emaste, ivy Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50247 (cherry picked from commit df16cbdcf1927200eb910c1874faee6f3d8b9a97) --- usr.bin/mail/extern.h | 1 - usr.bin/mail/lex.c | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/usr.bin/mail/extern.h b/usr.bin/mail/extern.h index 669c10b91beb..24ea67939ff2 100644 --- a/usr.bin/mail/extern.h +++ b/usr.bin/mail/extern.h @@ -133,7 +133,6 @@ int getrawlist(char *, char **, int); uid_t getuserid(char *); int grabh(struct header *, int); int group(void *); -void hangup(int); int hash(const char *); void hdrstop(int); int headers(void *); diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index b931d6e16a15..c5f4f26781ef 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -205,8 +205,6 @@ commands(void) if (!sourcing) { if (signal(SIGINT, SIG_IGN) != SIG_IGN) (void)signal(SIGINT, intr); - if (signal(SIGHUP, SIG_IGN) != SIG_IGN) - (void)signal(SIGHUP, hangup); (void)signal(SIGTSTP, stop); (void)signal(SIGTTOU, stop); (void)signal(SIGTTIN, stop); @@ -573,17 +571,6 @@ stop(int s) } } -/* - * Branch here on hangup signal and simulate "exit". - */ -void -hangup(int s __unused) -{ - - /* nothing to do? */ - exit(1); -} - /* * Announce the presence of the current Mail version, * give the message count, and print a header listing.