From a0a9bb8cdc7678fc802e0a38eae56dea785968b8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 1 May 2010 15:01:03 +0000 Subject: [PATCH] Check if chdir-command failed. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@537 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- dgl-common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dgl-common.c b/dgl-common.c index c572928..c434397 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -215,7 +215,12 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) if (p1 && (access(p1, F_OK) != 0)) unlink(p1); break; case DGLCMD_CHDIR: - if (p1) chdir(p1); + if (p1) { + if (chdir(p1) == -1) { + debug_write("chdir-command failed"); + graceful_exit(123); + } + } break; case DGLCMD_IF_NX_CP: if (p1 && p2) {