[ioquake3] 82/136: Fixed linking on things that need -ldl, and compiler warnings.

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 063875e89a3d1ab4f98e0f0e1d47a7f8173b7f07
Author: Ryan C. Gordon <icculus at icculus.org>
Date:   Fri Jun 2 01:39:03 2017 -0400

    Fixed linking on things that need -ldl, and compiler warnings.
---
 Makefile                   | 4 ++++
 code/sys/sys_autoupdater.c | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7b16040..322fc15 100644
--- a/Makefile
+++ b/Makefile
@@ -376,6 +376,7 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")
 
   THREAD_LIBS=-lpthread
   LIBS=-ldl -lm
+  AUTOUPDATER_LIBS += -ldl
 
   CLIENT_LIBS=$(SDL_LIBS)
   RENDERER_LIBS = $(SDL_LIBS) -lGL
@@ -834,6 +835,8 @@ ifeq ($(PLATFORM),irix64)
   SHLIBLDFLAGS=-shared
 
   LIBS=-ldl -lm -lgen
+  AUTOUPDATER_LIBS += -ldl
+
   # FIXME: The X libraries probably aren't necessary?
   CLIENT_LIBS=-L/usr/X11/$(LIB) $(SDL_LIBS) \
     -lX11 -lXext -lm
@@ -888,6 +891,7 @@ ifeq ($(PLATFORM),sunos)
 
   THREAD_LIBS=-lpthread
   LIBS=-lsocket -lnsl -ldl -lm
+  AUTOUPDATER_LIBS += -ldl
 
   BOTCFLAGS=-O0
 
diff --git a/code/sys/sys_autoupdater.c b/code/sys/sys_autoupdater.c
index 2982f85..1ed908d 100644
--- a/code/sys/sys_autoupdater.c
+++ b/code/sys/sys_autoupdater.c
@@ -59,9 +59,13 @@ void Sys_LaunchAutoupdater(int argc, char **argv)
 				char *ptr = strrchr(argv[0], '/');
 				if (ptr)
 					*ptr = '\0';
-				chdir(argv[0]);
+				if (chdir(argv[0]) == -1) {
+					_exit(1);  /* oh well. */
+				}
 				#ifdef __APPLE__
-				chdir("../..");  /* put this at base of app bundle so paths make sense later. */
+				if (chdir("../..") == -1) {  /* put this at base of app bundle so paths make sense later. */
+					_exit(1);  /* oh well. */
+				}
 				#endif
 				snprintf(pidstr, sizeof (pidstr), "%lld", (long long) getppid());
 				execl(AUTOUPDATER_BIN, AUTOUPDATER_BIN, "--waitpid", pidstr, NULL);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list