Skip to content
Snippets Groups Projects
Select Git revision
  • dualcore
  • ch3/leds
  • wip-bootstrap default
  • ch3/time
  • master
5 results

main.c

Blame
    • Paul Sokolovsky's avatar
      11bc21df
      unix/main: Ignore SIGPIPE signal, instead make EPIPE arrive. · 11bc21df
      Paul Sokolovsky authored
      Do not raise SIGPIPE, instead return EPIPE. Otherwise, e.g. writing
      to peer-closed socket will lead to sudden termination of MicroPython
      process. SIGPIPE is particularly nasty, because unix shell doesn't
      print anything for it, so the above looks like completely sudden and
      silent termination for unknown reason. Ignoring SIGPIPE is also what
      CPython does. Note that this may lead to problems using MicroPython
      scripts as pipe filters, but again, that's what CPython does. So,
      scripts which want to follow unix shell pipe semantics (where SIGPIPE
      means "pipe was requested to terminate, it's not an error"), should
      catch EPIPE themselves.
      11bc21df
      History
      unix/main: Ignore SIGPIPE signal, instead make EPIPE arrive.
      Paul Sokolovsky authored
      Do not raise SIGPIPE, instead return EPIPE. Otherwise, e.g. writing
      to peer-closed socket will lead to sudden termination of MicroPython
      process. SIGPIPE is particularly nasty, because unix shell doesn't
      print anything for it, so the above looks like completely sudden and
      silent termination for unknown reason. Ignoring SIGPIPE is also what
      CPython does. Note that this may lead to problems using MicroPython
      scripts as pipe filters, but again, that's what CPython does. So,
      scripts which want to follow unix shell pipe semantics (where SIGPIPE
      means "pipe was requested to terminate, it's not an error"), should
      catch EPIPE themselves.