1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 45_top_exitcode.dpatch by <hesso@pool.math.tu-berlin.de>
4
## DP: Make top exit with return code 0 if the program was closed
5
## DP: cleanly ('q' or end of iteration loop).
8
--- procps-3.2.7/top.cO 2007-08-06 15:57:04.000000000 +0200
9
+++ procps-3.2.7/top.c 2007-08-06 16:04:07.000000000 +0200
14
- * Normal end of execution.
15
+ * Normal end of execution. Exit with 1 if signaled, else 0.
17
* SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT and SIGTERM */
18
-static void end_pgm (int dont_care_sig) NORETURN;
19
-static void end_pgm (int dont_care_sig)
20
+static void end_pgm (int sig) NORETURN;
21
+static void end_pgm (int sig)
23
- (void)dont_care_sig;
24
- bye_bye(stdout, 1, NULL);
25
+ bye_bye(stdout, !!sig, NULL);