changeset 3775:aa1491f8167b

/dev/zero bad permissions error message
author arpi
date Wed, 26 Dec 2001 22:33:15 +0000
parents 68dae60dd470
children a90d45d7bde6
files loader/ext.c loader/ldt_keeper.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/loader/ext.c	Wed Dec 26 21:45:23 2001 +0000
+++ b/loader/ext.c	Wed Dec 26 22:33:15 2001 +0000
@@ -250,7 +250,7 @@
         {
             if ((fdzero = open( "/dev/zero", O_RDONLY )) == -1)
             {
-                perror( "/dev/zero: open" );
+    		perror( "Cannot open /dev/zero for READ. Check permissions! error: " );
                 exit(1);
             }
         }
@@ -366,8 +366,10 @@
     {
 	anon=1;
 	hFile=open("/dev/zero", O_RDWR);
-	if(hFile<0)
+	if(hFile<0){
+    	    perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
 	    return 0;
+	}
     }
     if(!anon)
     {
@@ -455,6 +457,10 @@
 {
     void* answer;
     int fd=open("/dev/zero", O_RDWR);
+    if(fd<0){
+        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
+	return NULL;
+    }
     size=(size+0xffff)&(~0xffff);
     //printf("VirtualAlloc(0x%08X, %d)\n", address, size);
     if(address!=0)
--- a/loader/ldt_keeper.c	Wed Dec 26 21:45:23 2001 +0000
+++ b/loader/ldt_keeper.c	Wed Dec 26 22:33:15 2001 +0000
@@ -157,6 +157,10 @@
 
     prev_struct = 0;
     fd = open("/dev/zero", O_RDWR);
+    if(fd<0){
+        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
+	return;
+    }
     fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE,
 		  fd, 0);
     if(fs_seg==(void*)-1)