1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-25 16:31:57 +00:00
powerlevel10k/internal
romkatv 7354eeaa96 workaround for a bug in sysread
There is a bug in sysread from zsh/system. It triggers in the
following case:

1. zsh has been compiled with HAVE_SELECT and without HAVE_POLL.
2. sysread is called with timeout (-t).
3. the input file descriptor is valid but there is no data to read.
4. errno happens to be EINTR prior to the call to sysread.

This results in an infinite loop in sysread:

  while ((ret = select(infd+1, (SELECT_ARG_2_T) &fds,
                       NULL, NULL,&select_tv)) < 1) {
    if (errno != EINTR || errflag || retflag || breaks || contflag)
      break;
  }

Here select() keeps returning 0, indicating timeout. This is not an
error, so errno doesn't get set. If it was EINTR prior to the call,
it stays EINTR, and the loop keeps spinning.

As a workaround, powerlevel10k sets errno to ENOTTY (any value other
than EINTR will do) prior to calling sysread with timeout.
2020-02-05 14:37:43 +01:00
..
configure.zsh quote $foo when running with unknown options; fixes #453 2020-02-01 22:03:42 +01:00
icons.zsh when the user's locale is misconfigured, set it to utf8 at the top level 2020-02-05 12:50:58 +01:00
notes.txt add tabbed to the list of precommands 2020-01-28 13:08:02 +01:00
p10k.zsh workaround for a bug in sysread 2020-02-05 14:37:43 +01:00
parser.zsh quote $foo when running with unknown options; fixes #453 2020-02-01 22:03:42 +01:00
wizard.zsh when the user's locale is misconfigured, set it to utf8 at the top level 2020-02-05 12:50:58 +01:00
worker.zsh workaround for a bug in sysread 2020-02-05 14:37:43 +01:00