[Toybox] read_password() doesn't print prompt

Rob Landley rob at landley.net
Thu May 16 05:46:47 PDT 2019


On 5/16/19 4:03 AM, William Djupström via Toybox wrote:
> since xprintf() doesn't always flush, if the read_password() message
> doesn't have a newline at the end, which it usually doesn't, the prompt
> won't show up until after you've entered your password.

Sigh. This problem makes me said, and it's why I created xprintf() in the first
place.

What I need is either an alarm() that calls flush if nothing more has been
printed in half a second or having every input function call fflush(0) first. Or
to make xprintf() call xflush() again which is why I created xprintf() in the
first place...

What I really want is a canellable set_timer() function that calls a defined
function() after a timeout, which won't interfere with existing uses of alarm().
Unfortunately timer_create() requires -lrt which pulls in pthread on glibc
now!). I dunno how/why glibc broke that, but maybe I can just write glibc off a
too broken to care about anymore? Hmmm...

Rob



More information about the Toybox mailing list