Whoops...mode_t is apparently 16 bits.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 28 Jan 2006 01:00:27 +0000
changeset 102 93699a88262a
parent 101 98288e66c2e1
child 103 0f2c360e6cf6
Whoops...mode_t is apparently 16 bits.
mojopatch.c
--- a/mojopatch.c	Fri Jan 27 19:40:20 2006 +0000
+++ b/mojopatch.c	Sat Jan 28 01:00:27 2006 +0000
@@ -1363,7 +1363,7 @@
         goto handle_add_done;
     } /* if */
 
-    chmod(add->fname, add->mode);  /* !!! FIXME: Should this be an error condition? */
+    chmod(add->fname, (mode_t) add->mode);  /* !!! FIXME: Should this be an error condition? */
 
     _current_operation("VERIFY %s", final_path_element(add->fname));
     io = fopen(add->fname, "rb");
@@ -1466,7 +1466,7 @@
     } /* if */
 
     /* !!! FIXME: Pass this to mkdir? */
-    chmod(adddir->fname, adddir->mode);  /* !!! FIXME: Should this be an error condition? */
+    chmod(adddir->fname, (mode_t) adddir->mode);  /* !!! FIXME: Should this be an error condition? */
 
     _log("done ADDDIRECTORY.");
     return(PATCHSUCCESS);
@@ -1704,7 +1704,7 @@
         return(PATCHERROR);
     } /* if */
 
-    chmod(patch->fname, patch->mode);  /* !!! FIXME: fatal error? */
+    chmod(patch->fname, (mode_t) patch->mode);  /* !!! FIXME: fatal error? */
 
     _log("done PATCH.");
     return(PATCHSUCCESS);
@@ -2647,7 +2647,7 @@
     int retval = PATCHSUCCESS;
 
     /* !!! FIXME: We need to serialize this, so we serialize it as uint32. */
-    assert(sizeof (mode_t) == sizeof (unsigned int));
+    assert(sizeof (mode_t) <= sizeof (unsigned int));
 
     memset(&header, '\0', sizeof (header));