NetBSD Problem Report #33944

From www@NetBSD.org  Fri Jul  7 22:30:44 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id 9852C63B8C3; Fri,  7 Jul 2006 22:30:44 +0000 (UTC)
Message-Id: <20060707223044.9852C63B8C3@narn.NetBSD.org>
Date: Fri,  7 Jul 2006 22:30:44 +0000 (UTC)
From: tomsbsd04@tiscali.de
Reply-To: tomsbsd04@tiscali.de
To: gnats-bugs@NetBSD.org
Subject: usbhidctl -l does not flush stdout when input events are printed
X-Send-Pr-Version: www-1.0

>Number:         33944
>Category:       bin
>Synopsis:       usbhidctl -l does not flush stdout when input events are printed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 07 22:35:00 +0000 2006
>Originator:     Thomas Bieg
>Release:        3.0_STABLE
>Organization:
>Environment:
>Description:
Due to the interactive nature of its output, "usbhidctl -l" should flush
stdout after each printed event, so that redirecting the output becomes
usable.

In its current state when stdout is redirected nothing is output unless
stdout buffer becomes full and thus is flushed. If the command is aborted
before the buffer filled up nothing is output at all.

>How-To-Repeat:
Execute "usbhidctl -f0 -a -l | cat" with any USB HID input device attached
to /dev/uhid0 and start producing input events.

>Fix:
This works for me, don't know if it's the recommended way:

*** src/usr.bin/usbhidctl/usbhid.c.orig     Wed May 10 23:53:48 2006
--- src/usr.bin/usbhidctl/usbhid.c  Fri Jul  7 22:00:28 2006
***************
*** 657,662 ****
--- 657,663 ----
                }
                hid_end_parse(hdata);
                printf("\n");
+               fflush(stdout);
        }
        /* NOTREACHED */
  }

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.