From nobody Wed May 14 19:20:47 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 4ZyNV81xY8z5vcmf; Wed, 14 May 2025 19:20:48 +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 4ZyNV76Fqfz3N8Z; Wed, 14 May 2025 19:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747250447; 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=Tn6Jz+GyE8JR+XvsypX+Wwv0wWOP712LhTS+JMPOqts=; b=BevE1Y0K8pl/vzBT3udsjZWB77YfVo3CUPjDV4zmkjkvpGwAkh0X1a9bVxzQstrblz3yde QM28aIR0yRGls76++Ct/C/ie0mjgf0ytbSpMOYzNrAJ4cHrCJ1BFdM/kRRw6KcME9K/lJz qTingHyLSATJ+xQoVq8QMTpg418SPLKU64n8ZGcVfn3aLiSXuhrbyIUVHbr6ZsTEdvMhmv lIW1GXn68aiRjdbhwwfacXrizpHdyPZyEnDHrhWcpzocNw2DOQ5xWNWDNHCpU9QG4h6nWI C9sS+44pV7qryogbu14ssACunhIlZwJGfKg8nfczZ1Q3B9l5dFCU5mkUFnU0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747250447; 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=Tn6Jz+GyE8JR+XvsypX+Wwv0wWOP712LhTS+JMPOqts=; b=o0nEaaMOw7QFZkxVNTk2Kxda2O7ar+6zvTtDtQZkwYkGWYer3TMTphM5/fAQbuzEf7tzPU 9y2AsmPbhDVphKsxzUNn69uA9fHo6SAD4fK8fzES40eAHm+hj5kuDecdW5B596QpNbQZ39 ilj52/s1rZTxSAzNWxjsgg65YQr8xFL8GZZEBlCgaRt9lUwyFFq6WHRW4TDAjb+42Xe9kM FjKwtH9VE7ndqA2Z+gba8KPJHoVFA+QKYvH+fyt/WLCHd3260p91v2/7CjvSflpDYcz/1i MMNGPmPXntWGpz+YfRc9hzwCySeAJv18QBRxzLVu2ahMGv115iChtvJ+lV2XCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747250447; a=rsa-sha256; cv=none; b=dI87GrDGPEoIWJ5iAdS+4PsU7TRd2dj0ADQREGEwhm0JpbolUFwq7BqXzI1omJ7Yi+Lr0K k943Mukf662vSiYNGhRmMvPhOut7uRH0UJeaRv8nEhpNsjQ34WP/sdfbDiELs1LupLZZJC B8KWK3/whGqXAGf4zMu54Tfzu8cPpU85/8GkUBMEtTzcxCLdGGhTmYLNkG8RVdkpAgcBRn gerEIEsl3CM0ps6UqSn/wW/Ak51AhNW0VgqPKJaIstLPoe9iGlUyD8VQKR4YMUY80WSdqJ anbwbX+wq7DATh9bXbLLBFXO8yi3PavZZlq7FpLabsa9eWhQuKAB3ZyGf7ORGQ== 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 4ZyNV75kNQzlHT; Wed, 14 May 2025 19:20:47 +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 54EJKlYi015156; Wed, 14 May 2025 19:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54EJKlRD015153; Wed, 14 May 2025 19:20:47 GMT (envelope-from git) Date: Wed, 14 May 2025 19:20:47 GMT Message-Id: <202505141920.54EJKlRD015153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: df16cbdcf192 - main - 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df16cbdcf1927200eb910c1874faee6f3d8b9a97 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=df16cbdcf1927200eb910c1874faee6f3d8b9a97 commit df16cbdcf1927200eb910c1874faee6f3d8b9a97 Author: Kyle Evans AuthorDate: 2025-05-14 19:20:16 +0000 Commit: Kyle Evans CommitDate: 2025-05-14 19:20:34 +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 --- 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 efcba2141512..6eea9c1f1f88 100644 --- a/usr.bin/mail/extern.h +++ b/usr.bin/mail/extern.h @@ -131,7 +131,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 1043dd2d4706..2d86a17c13e9 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -199,8 +199,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); @@ -567,17 +565,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.