File: 50_display.dpatch

package info (click to toggle)
yeahconsole 0.3.4-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 108 kB
  • ctags: 49
  • sloc: ansic: 362; xml: 184; makefile: 70; sh: 40
file content (20 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_display.dpatch by Damián Viano <debian@damianv.com.ar>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fixes segfault when $DISPLAY is not defined/can't be opened

@DPATCH@
diff -Nura yeahconsole-0.3.4/yeahconsole.c yeahconsole-0.3.4.r.bk/yeahconsole.c
--- yeahconsole-0.3.4/yeahconsole.c	2006-03-11 15:26:00.000000000 -0300
+++ yeahconsole-0.3.4.r.bk/yeahconsole.c	2006-07-01 17:49:14.000000000 -0300
@@ -107,7 +107,8 @@
     }
 
     if (!(dpy = XOpenDisplay(NULL))) {
-	fprintf(stderr, " can not open dpy %s", XDisplayName(NULL));
+	fprintf(stderr, "Can not open display %s\n", XDisplayName(NULL));
+	exit(1);
     }
     screen = DefaultScreen(dpy);
     root = RootWindow(dpy, screen);