Re: Issues with sndioctl -m output

From: Érico Nogueira <ericonr_at_disroot.org>
Date: Sun, 06 Sep 2020 11:31:53 -0300
On Sun Sep 6, 2020 at 7:54 AM -03, Alexandre Ratchov wrote:
> Hi,
>
> The "setlinebuf(stdout)" call is missing when the loop correstponding
> to -m starts. Does this works for you?
>
> diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c
> index 4c4a85a..71ae298 100644
> --- a/sndioctl/sndioctl.c
> +++ b/sndioctl/sndioctl.c
> _at_@ -1014,6 +1014,7 @@ main(int argc, char **argv)
> perror("malloc");
> exit(1);
> }
> + setlinebuf(stdout);
> for (;;) {
> nfds = sioctl_pollfd(hdl, pfds, POLLIN);
> if (nfds == 0)

It doesn't seem to make any difference, unfortunately. Following
Duncan's idea does seem to work, however:

diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c
index 4c4a85a..71ae298 100644
--- sndioctl/sndioctl.c
+++ sndioctl/sndioctl.c
_at_@ -1014,6 +1014,7 @@ main(int argc, char **argv)
                        perror("malloc");
                        exit(1);
                }
                for (;;) {
+                       fflush(stdout);
                        nfds = sioctl_pollfd(hdl, pfds, POLLIN);
                        if (nfds == 0)
Received on Sun Sep 06 2020 - 16:31:53 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2022 - 16:23:49 CEST