src/platform_unix.c
changeset 1240 22d4d1bd4e21
parent 1236 ad779490c5b6
child 1242 1e6db80d2393
--- a/src/platform_unix.c	Tue Mar 20 15:28:19 2012 -0400
+++ b/src/platform_unix.c	Tue Mar 20 15:38:12 2012 -0400
@@ -90,7 +90,7 @@
     struct mntent *ent = NULL;
 
     mounts = setmntent("/etc/mtab", "r");
-    BAIL_IF_MACRO(mounts == NULL, ERR_IO_ERROR, /*return void*/);
+    BAIL_IF_MACRO(mounts == NULL, PHYSFS_ERR_IO, /*return void*/);
 
     while ( (ent = getmntent(mounts)) != NULL )
     {
@@ -120,7 +120,7 @@
     FILE *mounts = fopen(MNTTAB, "r");
     struct mnttab ent;
 
-    BAIL_IF_MACRO(mounts == NULL, ERR_IO_ERROR, /*return void*/);
+    BAIL_IF_MACRO(mounts == NULL, PHYSFS_ERR_IO, /*return void*/);
     while (getmntent(mounts, &ent) == 0)
     {
         int add_it = 0;
@@ -161,8 +161,8 @@
     char *start = envr;
     char *ptr;
 
-    BAIL_IF_MACRO(bin == NULL, ERR_INVALID_ARGUMENT, NULL);
-    BAIL_IF_MACRO(envr == NULL, ERR_INVALID_ARGUMENT, NULL);
+    assert(bin != NULL);
+    assert(envr != NULL);
 
     do
     {
@@ -175,11 +175,11 @@
         if (size > alloc_size)
         {
             char *x = (char *) allocator.Realloc(exe, size);
-            if (x == NULL)
+            if (!x)
             {
                 if (exe != NULL)
                     allocator.Free(exe);
-                BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
+                BAIL_MACRO(PHYSFS_ERR_OUT_OF_MEMORY, NULL);
             } /* if */
 
             alloc_size = size;
@@ -276,7 +276,7 @@
     {
         /* If there's no dirsep on argv0, then look through $PATH for it. */
         envr = __PHYSFS_platformCopyEnvironmentVariable("PATH");
-        BAIL_IF_MACRO(!envr, NULL, NULL);
+        BAIL_IF_MACRO(!envr, ERRPASS, NULL);
         retval = findBinaryInPath(argv0, envr);
         allocator.Free(envr);
     } /* if */