changeset 198:7795b0938921

Advanced Rogue 5: replace calls to unlink() with md_unlink().
author John "Elwin" Edwards
date Tue, 11 Aug 2015 16:12:09 -0400
parents 61d1c9ac9be7
children efdbeec0816d
files arogue5/rogue.h arogue5/save.c
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/arogue5/rogue.h	Tue Aug 11 15:29:31 2015 -0400
+++ b/arogue5/rogue.h	Tue Aug 11 16:12:09 2015 -0400
@@ -984,6 +984,7 @@
 extern char *md_getroguedir();
 extern void md_init();
 extern FILE * md_fdopen(int fd, char *mode);
+extern int md_unlink(char *file);
 
 /*
  * Now all the global variables
--- a/arogue5/save.c	Tue Aug 11 15:29:31 2015 -0400
+++ b/arogue5/save.c	Tue Aug 11 16:12:09 2015 -0400
@@ -91,7 +91,7 @@
      */
     if (save_file(savef) != 0) {
 	msg("Cannot create save file.");
-	unlink(file_name);
+	md_unlink(file_name);
 	return(FALSE);
     }
     else return(TRUE);
@@ -235,9 +235,9 @@
 
     if (!wizard)
     {
-	if (unlink(file) < 0) {
+	if (md_unlink(file) < 0) {
             close(inf); /* only close if system insists */
-            if (unlink(file) < 0) {
+            if (md_unlink(file) < 0) {
                 endwin();
 	        printf("\nCannot unlink file\n");
 	        return FALSE;