[lgeneral] 02/05: Add segfaults-when-running-headless.patch
Markus Koschany
apo-guest at moszumanska.debian.org
Fri Jun 26 19:30:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
apo-guest pushed a commit to branch master
in repository lgeneral.
commit 575f13da61e4170e8c57a75e980f5eb579202922
Author: Markus Koschany <apo at gambaru.de>
Date: Fri Jun 26 20:41:56 2015 +0200
Add segfaults-when-running-headless.patch
lgc-pg requires a running graphical desktop environment for the conversion.
Now lgc-pg prints an error message and exits gracefully when it does not detect
this requirement.
Closes: #784259
---
.../patches/segfaults-when-running-headless.patch | 30 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 31 insertions(+)
diff --git a/debian/patches/segfaults-when-running-headless.patch b/debian/patches/segfaults-when-running-headless.patch
new file mode 100644
index 0000000..d5580cb
--- /dev/null
+++ b/debian/patches/segfaults-when-running-headless.patch
@@ -0,0 +1,30 @@
+From: Markus Koschany <apo at gambaru.de>
+Date: Fri, 26 Jun 2015 20:41:17 +0200
+Subject: segfaults when running headless
+
+lgc-pg requires a graphical desktop environment for the conversion.
+If it can't be detected, lgc-pg will print an error message and quit with exit
+code 1.
+
+Bug: https://bugs.debian.org/784259
+Forwarded: via private e-mail
+---
+ lgc-pg/main.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lgc-pg/main.c b/lgc-pg/main.c
+index 989bda3..da90d36 100644
+--- a/lgc-pg/main.c
++++ b/lgc-pg/main.c
+@@ -168,7 +168,10 @@ int main( int argc, char **argv )
+ }
+
+ /* SDL required for graphical conversion */
+- SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER );
++ if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER ) < 0) {
++ printf( "lgc-pg requires a running graphical desktop environment. \n");
++ exit( 1 );
++ }
+ SDL_SetVideoMode( 320, 240, 16, SDL_SWSURFACE );
+ atexit( SDL_Quit );
+ /* show nice image */
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..d137794
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+segfaults-when-running-headless.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/lgeneral.git
More information about the Pkg-games-commits
mailing list