From: ratchov Date: Wed, 3 Mar 2021 09:40:43 +0000 (+0000) Subject: sndioctl: Flush stdout before polling X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=74b220efb30d8b00307ad4dd56c66206bdfccf75;p=openbsd sndioctl: Flush stdout before polling If stdout is not flushed, output is not seen by programs using sndioctl through a pipe (ex. "sndioctl -m | cat" displays nothing). Patch from Erico Nogueira , idea from Duncan Overbruck --- diff --git a/usr.bin/sndioctl/sndioctl.c b/usr.bin/sndioctl/sndioctl.c index d95eb322437..aa174e77249 100644 --- a/usr.bin/sndioctl/sndioctl.c +++ b/usr.bin/sndioctl/sndioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndioctl.c,v 1.15 2020/06/28 05:21:39 ratchov Exp $ */ +/* $OpenBSD: sndioctl.c,v 1.16 2021/03/03 09:40:43 ratchov Exp $ */ /* * Copyright (c) 2014-2020 Alexandre Ratchov * @@ -1022,6 +1022,7 @@ main(int argc, char **argv) exit(1); } for (;;) { + fflush(stdout); nfds = sioctl_pollfd(hdl, pfds, POLLIN); if (nfds == 0) break;