Advertisement
ananas

Avoid zombie by less if LESSOPEN is used

May 28th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.75 KB | None | 0 0
  1. --- less-458/main.c.orig        2013-04-04 19:55:05.000000000 +0300
  2. +++ less-458/main.c     2014-05-28 14:00:04.586513424 +0300
  3. @@ -17,6 +17,10 @@
  4.  #include <windows.h>
  5.  #endif
  6.  
  7. +#ifndef WIN32
  8. +#include <signal.h>
  9. +#endif
  10. +
  11.  public char *  every_first_cmd = NULL;
  12.  public int     new_file;
  13.  public int     is_tty;
  14. @@ -106,6 +110,13 @@
  15.         GetConsoleTitle(consoleTitle, sizeof(consoleTitle)/sizeof(char));
  16.  #endif /* WIN32 */
  17.  
  18. +#ifndef WIN32
  19. +       /*
  20. +        * Ignore SIGCHLD foor avoid zombies when LESSOPEN is used
  21. +        */
  22. +       signal(SIGCHLD, SIG_IGN);
  23. +#endif /* WIN32 */
  24. +
  25.         /*
  26.          * Process command line arguments and LESS environment arguments.
  27.          * Command line arguments override environment arguments.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement