diff src/unexelfsgi.c @ 448:3078fd1074e8 r21-2-39

Import from CVS: tag r21-2-39
author cvs
date Mon, 13 Aug 2007 11:38:25 +0200
parents 1ccc32a20af4
children 023b83f4e54b
line wrap: on
line diff
--- a/src/unexelfsgi.c	Mon Aug 13 11:37:23 2007 +0200
+++ b/src/unexelfsgi.c	Mon Aug 13 11:38:25 2007 +0200
@@ -226,9 +226,10 @@
       fatal ("Can't fstat (%s): errno %d\n", old_name, errno);
 
   /* map old file into the address space. */
-  if ( (old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size,
-				   PROT_READ, MAP_SHARED, old_file, 0)) < 0 )
-      fatal ("Can't mmap (%s): errno %d\n", old_name, errno);
+  old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size,
+			     PROT_READ, MAP_SHARED, old_file, 0);
+  if (old_base == (caddr_t) MAP_FAILED)
+    fatal ("Can't mmap (%s): errno %d\n", old_name, errno);
 
   old_file_h    = (ElfW(Ehdr) *) old_base;
   old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff);