From 9ddff8ff34fc1c329f05090b27f8b9dc9f99dbfe Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Sun, 18 Apr 1999 13:11:11 +0000
Subject: [PATCH] (savecore): Use param.core_dir and param.savecore_path
 instead of 	hardcoding the values.

---
 src/server/updateLysKOM.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/server/updateLysKOM.c b/src/server/updateLysKOM.c
index 3db8debc4..c64e18a07 100644
--- a/src/server/updateLysKOM.c
+++ b/src/server/updateLysKOM.c
@@ -1,5 +1,5 @@
 /*
- * $Id: updateLysKOM.c,v 1.10 1999/04/17 22:02:18 ceder Exp $
+ * $Id: updateLysKOM.c,v 1.11 1999/04/18 13:11:11 ceder Exp $
  * Copyright (C) 1994, 1995  Lysator Academic Computer Association.
  *
  * This file is part of the LysKOM server.
@@ -150,12 +150,18 @@ static void
 savecore(void)
 {
     struct stat statbuf;
+    char *corefile;
 
-    if (stat(DEFAULT_PREFIX "cores/core", &statbuf) == 0
-	&& stat(DEFAULT_PREFIX "bin/savecore", &statbuf) == 0)
+    corefile = smalloc(strlen(param.core_dir) + 1 + 4 + 1);
+    strcpy(corefile, param.core_dir);
+    strcat(corefile, "/core");
+
+    if (stat(corefile, &statbuf) == 0
+	&& stat(param.savecore_path, &statbuf) == 0)
     {
-	system(DEFAULT_PREFIX "bin/savecore");
+	system(param.savecore_path);
     }
+    sfree(corefile);
 }
 
 int
@@ -199,7 +205,7 @@ main (int    argc,
 
 	case 'V':
 	case 'v':
-	    fprintf(stderr, "updateLysKOM %d $Revision: 1.10 $\n",
+	    fprintf(stderr, "updateLysKOM %d $Revision: 1.11 $\n",
 #include "version.incl"
 		    );
 	    exit(0);
-- 
GitLab