From nobody Wed Nov 27 12:22:44 2024 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 4Xyz9K2k57z5f723; Wed, 27 Nov 2024 12:22:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xyz9K16CZz4H5x; Wed, 27 Nov 2024 12:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732710165; 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=wLvb2kCg8fbQu4G/zP9YeqUV8e1NPENhYvpypZiTx3E=; b=r93uQ1QEJL3v6C+kumtCSORmxeQOXrQiyyfyoGgyMoRl4NYzdyfW1raIEBnodXJ37fCcUO s2D1QS+IWGeeUmuVRVw7QAo0Y2b1Ln2MICWrieecGNUQyrURdnxUe3bXMAU94zswVNzxXC kehAGCQapp9CAeM59Xqey+Ftn5j4RwBLUaD9y1S+Si+eQjbIcymQVbArWUWBUavlSqrZ3P WiU0By5EI6X8a/IT1S+cC0BDTkrxm3qsy38WMyKGRWbRb5KgZOFuaoDM39VA7yWA8EXxm2 mjHpfgRtavvR9cJ78ajqtbKM3C2F8zl3HzGmjA3Z7KNUzbOGNFFPHE28D3Gygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732710165; 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=wLvb2kCg8fbQu4G/zP9YeqUV8e1NPENhYvpypZiTx3E=; b=xuwmsnZF7xa8Db191PEO2haAV0EiKS66glnUUxtTMoj5ykxh+PByY0LO7DOJliON09RSUK S7KtCZzYvsZZH4NZjoiiUqh1lCmwi4xhXTV2rcVn7sfZqO5oAkfboEL33Fanp2Xsce2smU A7Jz6PXPRrFP/eX9G3Jf/BjVQEK/FTR6YV7ctoc2d7Xo821IrI/xrFVZX7MJMzCYXwSY+m y25DU2cRS07jPMSFhEWwBRblwRDrOklUf5tO4EKlfPcRehYfzmoj0pt6EsVnFvk+Ndu8Dw KSqBG28vdSWBC3aqXE+vugsD4J+yUg310x9ZgJpeMm/ba2m0kLYBj0UVPI9zYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732710165; a=rsa-sha256; cv=none; b=qiVCrCa3El3fQlHcb+wg/eF2tBnzrBQVSyDuCJh9pqGJzMobzTwFfI3bP2BeAVv6cRXIca My4HRlHTT+A51SDJ99qC6RLw21zNKYrRVytsXDURNrWcMGybNT/eQdh3lldcIHLlDT2NdM VfGmbzN3S1pMpO9pPN2wDxhBmZiuaRudF2jdypB7b/fwDusF6Mfjr7HWwpoX7jbxGxEZ4v KidQb3VE1ANLucB/mAzWigF6xKfgZEGoNBH9AWsFP/hig2+WFyDgjXqbZYIlVuQkthqiJW 0zyAMzKr8dqsE/Q7vMZlMmUKGBzvvO2+hjhCMfs9+m9co5x2R6PoPApjdFAsvQ== 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 4Xyz9J6xnZz18q9; Wed, 27 Nov 2024 12:22:44 +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 4ARCMi2o008436; Wed, 27 Nov 2024 12:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ARCMiNS008433; Wed, 27 Nov 2024 12:22:44 GMT (envelope-from git) Date: Wed, 27 Nov 2024 12:22:44 GMT Message-Id: <202411271222.4ARCMiNS008433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: fc26f24b3ef2 - main - colrm(1): Replace magic exit codes with standard macros 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: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc26f24b3ef276b2a9f73c9778aecff7377b1aeb Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=fc26f24b3ef276b2a9f73c9778aecff7377b1aeb commit fc26f24b3ef276b2a9f73c9778aecff7377b1aeb Author: Faraz Vahedi AuthorDate: 2024-10-27 08:59:39 +0000 Commit: Mariusz Zaborski CommitDate: 2024-11-27 12:20:11 +0000 colrm(1): Replace magic exit codes with standard macros Signed-off-by: Faraz Vahedi Reviewed by: markj, oshogbo MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1496 --- usr.bin/colrm/colrm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c index ffedc429eeb1..7f758b9cfbc6 100644 --- a/usr.bin/colrm/colrm.c +++ b/usr.bin/colrm/colrm.c @@ -68,12 +68,12 @@ main(int argc, char *argv[]) case 2: stop = strtol(argv[1], &p, 10); if (stop <= 0 || *p) - errx(1, "illegal column -- %s", argv[1]); + errx(EXIT_FAILURE, "illegal column -- %s", argv[1]); /* FALLTHROUGH */ case 1: start = strtol(argv[0], &p, 10); if (start <= 0 || *p) - errx(1, "illegal column -- %s", argv[0]); + errx(EXIT_FAILURE, "illegal column -- %s", argv[0]); break; case 0: break; @@ -82,7 +82,7 @@ main(int argc, char *argv[]) } if (stop && start > stop) - errx(1, "illegal start and stop columns"); + errx(EXIT_FAILURE, "illegal start and stop columns"); for (column = 0;;) { switch (ch = getwchar()) { @@ -115,15 +115,14 @@ void check(FILE *stream) { if (feof(stream)) - exit(0); + exit(EXIT_SUCCESS); if (ferror(stream)) - err(1, "%s", stream == stdin ? "stdin" : "stdout"); + err(EXIT_FAILURE, "%s", stream == stdin ? "stdin" : "stdout"); } void usage(void) { (void)fprintf(stderr, "usage: colrm [start [stop]]\n"); - exit(1); + exit(EXIT_FAILURE); } -