From nobody Fri Mar 10 13:29:19 2023 X-Original-To: dev-commits-src-main@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 4PY6N02rwpz3xX9G; Fri, 10 Mar 2023 13:29:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PY6N001sjz3R9x; Fri, 10 Mar 2023 13:29:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678454960; 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=a/Tqvx1isusz4JXd5gQrW6OUVorrRYvZ8TcPy8Q6dFM=; b=TOFVW59clPE5o3R+wRMxmjTQm/LFJdQfKRupkipB4WXBrsUOOoA+E1ZZJWxTZ4OryysZhA 3UsdNHfF1dN21S9zoJdqYJtDM9RoOgiJv2/qj8LNWqPbJw/YRdG+laDsUdeA4ZK+i/qwdN 64Y7l8MUs9Rcf0g4JtNpT3uuZjs6ffz9dstVeqFVHyGdCWy1B+wW1ARlIuGbsq6ic5d/KB TJX2g7DkY+NE9BmiprwSzs8P+N5Nfc3CstcAQeOAHsMlefyNXOfSDgl8ZFC0CqKvPv6wx0 6xHTkoSQ6sL65HlRWZUet78L3e2EqrJVY+57rGoOrblbp14M/vpLfeTWNheaRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678454960; 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=a/Tqvx1isusz4JXd5gQrW6OUVorrRYvZ8TcPy8Q6dFM=; b=n4AkEzXEJeC91+TXwQzJIL5mGyEjeNLEZmfzCGmsrq9WRF2YQyYky0RrOvga7tHE9tDa7l KkMhJmBe5gCdz7dhmVAncLq6JNTrZHbfmE2oQNst/QRklrlTbcWl9CjcYDj81PpCbwBPIZ ccBoMHGQcnEZTDFVup5rKxaQy1GGTcuAV0z0IK4EDNWi8hsmUIFp7UyGZON4AqXGhyo0ST SIy1V8B/EYKA0bPe5CTxMkTsdndaBmroeyqRzxXtA5hMMJ/MW9aVjIBtKUtYT3Xr5NPcsp vjuy7AJhOLcxkQSczTB5Q/NNl5r5e85gLn3B0dDutAKVUBbVEBA6uBUdac9X9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678454960; a=rsa-sha256; cv=none; b=VatfwM8z1Mig3Hhxwr78ncWgce6hQwl5PwRB3LUPpe5BdM1OzFvvk2c5t6WBz3bTR7huAA rAfwJhvZJV097q7bIaMLRIS8f6O5G60rHE1UTr9jvzg1baCbaaHehXtB7YFvBpK9KjF3NI KeRBOlYsGhfcZBHb7rDwRYDcUmPIJYAuwcQyjSvNvTDya4oGl+oWYRne8wXusN2joYM4KF 1DpNCpkiJc3SgVJf9O5OgZpsARNOz7aqrBEsowThrsof+BqFOQWpJM8kXrH6RB1rTEK4TX yLZa34wcB4/0G3AZqYx6j/V0qSqGR+h4NuYffDmiVjQta60y5/CvOPIxuRQPEw== 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 4PY6Mz6Ffbzqfp; Fri, 10 Mar 2023 13:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32ADTJs4090105; Fri, 10 Mar 2023 13:29:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32ADTJvg090104; Fri, 10 Mar 2023 13:29:19 GMT (envelope-from git) Date: Fri, 10 Mar 2023 13:29:19 GMT Message-Id: <202303101329.32ADTJvg090104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 9f6f64941c02 - main - tftpd: Make the -d option behave as documented. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9f6f64941c02596b01367fd99abdd2c91ba0fe79 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9f6f64941c02596b01367fd99abdd2c91ba0fe79 commit 9f6f64941c02596b01367fd99abdd2c91ba0fe79 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-10 13:24:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-10 13:25:16 +0000 tftpd: Make the -d option behave as documented. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38965 --- libexec/tftpd/tftpd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index c592a592bf7f..4b8a3024fe5a 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -140,7 +140,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:u:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:u:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; @@ -149,7 +149,9 @@ main(int argc, char *argv[]) ipchroot = 2; break; case 'd': - if (atoi(optarg) != 0) + if (optarg == NULL) + debug++; + else if (atoi(optarg) != 0) debug += atoi(optarg); else debug |= debug_finds(optarg);