summaryrefslogtreecommitdiff
path: root/debian/patches/23exitcode_q_ls.patch
blob: 69b9c5c57e4e8ccd4722d72eb1f61f0bfa7b9efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Author: <hesso@pool.math.tu-berlin.de>
Description: Make the exitcode of '-q -ls' and friends ('-qr -ls' and even
'-qdr -ls') match the documentation.
Index: screen/screen.c
===================================================================
--- screen.orig/screen.c	2011-10-08 19:58:41.000000000 +0200
+++ screen/screen.c	2011-10-08 19:58:51.000000000 +0200
@@ -1164,8 +1164,12 @@
 #endif
       SET_GUID();
       i = FindSocket((int *)NULL, &fo, &oth, SockMatch);
-      if (quietflag)
-        exit(8 + (fo ? ((oth || i) ? 2 : 1) : 0) + i);
+      if (quietflag) {
+        if (rflag)
+          exit(10 + i);
+        else
+          exit(9 + (fo || oth ? 1 : 0) + fo);
+      }
       if (fo == 0)
         Panic(0, "No Sockets found in %s.\n", SockPath);
       Panic(0, "%d Socket%s in %s.\n", fo, fo > 1 ? "s" : "", SockPath);