raspberrypi / utils

A collection of scripts and simple applications
BSD 3-Clause "New" or "Revised" License
134 stars 41 forks source link

Why redirect STDOUT of pinctrl "e.g. pinctrl poll 5 > out.txt" not work? #84

Closed thorsten-l closed 1 month ago

thorsten-l commented 1 month ago

I tried to open a pipe to pinctrl, but even a simple redirect to a file does not work. e.g. pinctrl poll 5 > out.txt out.txt length ist always zero.

If "pinctrl poll 5" is started without redirect stdout, everything works fine as expected.

btw "pinctrl > out.txt" works fine. May be a "fflush(stdout)" in after line 309 in pinctrl.c would be a solution.

thorsten-l commented 1 month ago

A "fflush(stdout)" after line 309 in pinctrl.c IS the solution! Should is do a merge request? - for a single line of code ... :)

pelwell commented 1 month ago

Yes, if you want. Otherwise, I'll get round to it eventually.