summaryrefslogtreecommitdiff
path: root/debian/patches/23exitcode_q_ls.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/23exitcode_q_ls.patch')
-rw-r--r--debian/patches/23exitcode_q_ls.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/patches/23exitcode_q_ls.patch b/debian/patches/23exitcode_q_ls.patch
new file mode 100644
index 0000000..87177eb
--- /dev/null
+++ b/debian/patches/23exitcode_q_ls.patch
@@ -0,0 +1,20 @@
+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.
+--- a/screen.c
++++ b/screen.c
+@@ -1181,8 +1181,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);