Blob Blame Raw
--- singularity-2.0/src/image-mount.c~
+++ singularity-2.0/src/image-mount.c
@@ -127,12 +127,12 @@
 
     loop_dev = obtain_loop_dev();
 
-    if ( ( containerimage_fp = fopen(containerimage, "r+") ) < 0 ) {
+    if ( !( containerimage_fp = fopen(containerimage, "r+") ) ) {
         fprintf(stderr, "ERROR: Could not open image %s: %s\n", containerimage, strerror(errno));
         return(255);
     }
 
-    if ( ( loop_fp = fopen(loop_dev, "r+") ) < 0 ) {
+    if ( !( loop_fp = fopen(loop_dev, "r+") ) ) {
         fprintf(stderr, "ERROR: Failed to open loop device %s: %s\n", loop_dev, strerror(errno));
         return(-1);
     }

--- singularity-2.0/src/image-bind.c~
+++ singularity-2.0/src/image-bind.c
@@ -67,14 +67,14 @@
             return(1);
         }
 
-        if ( ( containerimage_fp = fopen(containerimage, "r+") ) < 0 ) {
+        if ( !( containerimage_fp = fopen(containerimage, "r+") ) ) {
             fprintf(stderr, "ERROR: Could not open image %s: %s\n", containerimage, strerror(errno));
             return(255);
         }
 
         loop_dev = obtain_loop_dev();
 
-        if ( ( loop_fp = fopen(loop_dev, "r+") ) < 0 ) {
+        if ( !( loop_fp = fopen(loop_dev, "r+") ) ) {
             fprintf(stderr, "ERROR: Failed to open loop device %s: %s\n", loop_dev, strerror(errno));
             return(255);
         }
@@ -96,7 +96,7 @@
             return(255);
         }
 
-        if ( ( loop_fp = fopen(loop_dev, "r+") ) < 0 ) {
+        if ( !( loop_fp = fopen(loop_dev, "r+") ) ) {
             fprintf(stderr, "ERROR: Failed to open loop device %s: %s\n", loop_dev, strerror(errno));
             return(255);
         }

--- singularity-2.0/src/sexec.c~
+++ singularity-2.0/src/sexec.c
@@ -282,7 +282,7 @@
     if ( flock(lockfile_fd, LOCK_EX | LOCK_NB) == 0 ) {
         loop_dev = obtain_loop_dev();
 
-        if ( ( loop_fp = fopen(loop_dev, "r+") ) < 0 ) {
+        if ( !( loop_fp = fopen(loop_dev, "r+") ) ) {
             fprintf(stderr, "ERROR: Failed to open loop device %s: %s\n", loop_dev, strerror(errno));
             syslog(LOG_ERR, "Failed to open loop device %s: %s", loop_dev, strerror(errno));
             return(255);
@@ -308,7 +308,7 @@
             return(255);
         }
 
-        if ( ( loop_fp = fopen(loop_dev, "r") ) < 0 ) {
+        if ( !( loop_fp = fopen(loop_dev, "r") ) ) {
             fprintf(stderr, "ERROR: Failed to open loop device %s: %s\n", loop_dev, strerror(errno));
             return(255);
         }