The International Simutrans Forum

 

Author Topic: FIx for SIGPIPE crash on other OS than Windows  (Read 673 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 424
  • Languages: JP,EN
FIx for SIGPIPE crash on other OS than Windows
« on: April 18, 2020, 09:42:43 AM »
The UNIX system call "send()" sends SIGPIPE signal when the socket breaks while sending data. The default handling of SIGPIPE is terminating the program on the most platforms, and we have to handle this signal.

The sending error itself is handled in the program so we can just ignore SIGPIPE signal. The attached patch makes system ignore SIGPIPE signal to prevent meaningless program termination.

Please note that Windows does not have SIGPIPE and I excluded the code using macros.

Offline makie

  • Devotee
  • *
  • Posts: 306
    • Homepage PAK128-German
  • Languages: DE
Re: FIx for SIGPIPE crash on other OS than Windows
« Reply #1 on: April 18, 2020, 12:39:54 PM »
Maybe this is my problem too
Quote
prevent meaningless program termination.

Online Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4869
  • Languages: EN, DE, AT
Re: FIx for SIGPIPE crash on other OS than Windows
« Reply #2 on: April 18, 2020, 06:14:10 PM »
Thanks, in r9029.