Commit Graph

28 Commits (f9f3aa594af565a2794126857355d5408c09c44e)

Author SHA1 Message Date
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.
5 years ago
romkatv fab13389f1 remove profiling instrumentation 5 years ago
romkatv 4b62cd7380 bug fix: make reset=2 sticky 5 years ago
romkatv eb9da89ad9 quote $foo when running with unknown options; fixes #453 5 years ago
romkatv a9715367d4 fix prompt_char (never showed error); unify options 5 years ago
romkatv 8d2ab89627 remove debugging junk 5 years ago
romkatv 57dc301d6e bug fix: declare worker global vars in _p9k_init_vars 5 years ago
romkatv f1bb5601fe process ready replies from worker synchornously in precmd 5 years ago
romkatv e97a6c6701 delete fifo before killing worker from watchdog 5 years ago
romkatv 2dc56d0afe trap PIPE 5 years ago
romkatv 565492b10e migrate over from the old worker api; use worker in battery on macOS 5 years ago
romkatv 148ecf7fc3 use ascii ENQ (0x05) for watchdog pings 5 years ago
romkatv 45d14cbcf5 add watchdog to worker 5 years ago
romkatv 2aa1d07b4a massive worker simplification (figure out during massive hangover) 5 years ago
romkatv 0f6b7953be synthesize common prompt functions 5 years ago
romkatv e01b5d9529 refactor worker code 5 years ago
romkatv c79108ff0a work around wsl bugs 5 years ago
romkatv 430c2b0178 explicit exec in worker 5 years ago
romkatv 635ffb0e21 load the same modules and functions in worker as in master 5 years ago
romkatv 61df3d1cfb even further simplify worker bootstrap 5 years ago
romkatv 23e8921b8d further simplify worker bootstrap 5 years ago
romkatv 1208fd10ef simplify worker bootstrap 5 years ago
romkatv 0d33157b12 migrate disk_usage and public_ip to worker 5 years ago
romkatv a6e0b01dc1 remove explicit timeout support from worker 5 years ago
romkatv da498aef57 support parallelism in worker 5 years ago
romkatv 145b1a1103 cleanup 5 years ago
romkatv e0e6a4bf49 cleanup 5 years ago
romkatv aa0f435d75 add worker.zsh 5 years ago