From nobody Mon Oct 21 11:21:27 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 4XXCYg3mGvz5Ys7C; Mon, 21 Oct 2024 11:21:27 +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 4XXCYg37lmz44tC; Mon, 21 Oct 2024 11:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729509687; 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=Av2a6Vs44NIy8kvaBrFS2uZ2OMYWPXMyHY/cWcrxpJM=; b=arB8PMIWq5wLkzKumpWTKyBfIa7uG/miPDvUaDG2gglYGxSYvgXWuhdKlWVuMGOfUDXbWn Dpe4v9drN2P2Q+xyLxqQPXCNWBIT7N4MmSZg5iD36c42KrwboLgWdhvgYAFvS+fSHmoW74 Ezu2Xmn+3Q5P6RB9AcW8tgAu8Kn3pGPU8s/kBj8M7UEnhenb/jhf3deGpAB11u1eMFDxNN aNC5u8Rt78K48Gzy2nsfZhn7NcqSBQWBj/zr5ObRZiFx+HeWApP5Wl/+60rZFRr1yxT76a NpZSIUJsQgHKuLXrfrLO6YWxNEeyKqOXh9keIpUsHMCptw67DFJncq7PVSEHxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729509687; 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=Av2a6Vs44NIy8kvaBrFS2uZ2OMYWPXMyHY/cWcrxpJM=; b=Oxk/K4eN0LdGldMvkA3/MTPA6U+1aGT8uRv8ZrN9EhVBW0JtNPk/BJu9anJJ3UpUF/Fswo 1ncmSWNkorxhEBleSVmTWCE5weZmkkcNb9Yqafl6g4O2QjVz8NTHWqL/oZjmtwY/BhySPs 7OzQnmrxvI/1N2RNXzkCIrFm5anCxPdXHLOPxpjuZt+sCK8J6YT+7UXOLiuugu/DcvRoCM 8cGobXsv1qFOUkIhk74dqQYvcuy0fO7YInZvyiRz+W1eFGOkxP/dTYUivRTOzUNeIZz/tB eiXaKPq+GhTsDLync7wha30TQ5uLCG5+nBgQrLSv91uld4yCH8WOc/ERrpsGew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729509687; a=rsa-sha256; cv=none; b=WCg+bX1+/x68VPtJIZ8YIByH71rzRPoX6ziHN7prZMGgvwhL/suMXznKdmDCbGjh2NH/nL +vOaIvpZlxI3msCmZJlcSWYxsFFfJHG0km8bfAEMo6ZZliO+fGCF75dOLMABnfXKc4Lvoh UMfduh/X5uhPVLl4EtLOOgcUhcN6M2KsFkGPkHOEkNQ7Evf2QSfpi8dE/P7F66ITTSWxPJ uaEIul05khSOOPmK1qHQNCt6TA6/QyyJHrpGjLbCvWUph5Z/E7/qcHY38TZfPxW+2D0R1Y mL//1OlGbk35PYaCXmYqynm4g+0sZZN/wz2Ing+ggMN+Mt9puhWiVRyAm+UpCg== 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 4XXCYg2kbzzSbs; Mon, 21 Oct 2024 11:21:27 +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 49LBLRtF031636; Mon, 21 Oct 2024 11:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LBLR52031622; Mon, 21 Oct 2024 11:21:27 GMT (envelope-from git) Date: Mon, 21 Oct 2024 11:21:27 GMT Message-Id: <202410211121.49LBLR52031622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: f50d2fced24f - main - Give usbdump a '-u' option for unbuffered output. 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: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f50d2fced24f4dbffc1cc414da48ea7ef7b84d1e Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=f50d2fced24f4dbffc1cc414da48ea7ef7b84d1e commit f50d2fced24f4dbffc1cc414da48ea7ef7b84d1e Author: Poul-Henning Kamp AuthorDate: 2024-10-21 11:21:05 +0000 Commit: Poul-Henning Kamp CommitDate: 2024-10-21 11:21:05 +0000 Give usbdump a '-u' option for unbuffered output. --- usr.sbin/usbdump/usbdump.8 | 3 +++ usr.sbin/usbdump/usbdump.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/usbdump/usbdump.8 b/usr.sbin/usbdump/usbdump.8 index 33b759e3406d..96be9f738e2d 100644 --- a/usr.sbin/usbdump/usbdump.8 +++ b/usr.sbin/usbdump/usbdump.8 @@ -37,6 +37,7 @@ .Op Fl i Ar ifname .Op Fl r Ar file .Op Fl s Ar snaplen +.Op Fl u .Op Fl v .Op Fl w Ar file .Op Fl f Ar filter @@ -89,6 +90,8 @@ This option also works with the -f option. Snapshot .Ar snaplen bytes from each packet. +.It Fl u +Unbuffered output. .It Fl v Enable debugging messages. When defined multiple times the verbosity level increases. diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c index 9c4b6c67c07d..887e2baeed26 100644 --- a/usr.sbin/usbdump/usbdump.c +++ b/usr.sbin/usbdump/usbdump.c @@ -829,7 +829,7 @@ main(int argc, char *argv[]) const char *optstring; char *pp; - optstring = "b:d:hi:r:s:vw:f:"; + optstring = "b:d:hi:r:s:uvw:f:"; while ((o = getopt(argc, argv, optstring)) != -1) { switch (o) { case 'b': @@ -899,6 +899,10 @@ main(int argc, char *argv[]) if (snapshot == 0) snapshot = -1; break; + case 'u': + setbuf(stdout, NULL); + setbuf(stderr, NULL); + break; case 'v': verbose++; break;