platform/unix.c
changeset 137 66bddb94b6e0
parent 133 293f14af15c8
child 145 d6385584f6c4
--- a/platform/unix.c	Mon Mar 25 05:01:29 2002 +0000
+++ b/platform/unix.c	Mon Mar 25 05:02:12 2002 +0000
@@ -639,19 +639,26 @@
 
 int __PHYSFS_platformFlush(void *opaque)
 {
-    int rc = fflush((FILE *) opaque);
-    BAIL_IF_MACRO(rc == EOF, strerror(errno), 0);
+    errno = 0;
+    BAIL_IF_MACRO(fflush((FILE *) opaque) == EOF, strerror(errno), 0);
     return(1);
 } /* __PHYSFS_platformFlush */
 
 
 int __PHYSFS_platformClose(void *opaque)
 {
-    int rc = fclose((FILE *) opaque);
-    BAIL_IF_MACRO(rc == EOF, strerror(errno), 0);
+    errno = 0;
+    BAIL_IF_MACRO(fclose((FILE *) opaque) == EOF, strerror(errno), 0);
     return(1);
 } /* __PHYSFS_platformClose */
 
 
+int __PHYSFS_platformDelete(const char *path)
+{
+    errno = 0;
+    BAIL_IF_MACRO(remove(path) == -1, strerror(errno), 0);
+    return(1);
+} /* __PHYSFS_platformDelete */
+
 /* end of unix.c ... */