]> granicus.if.org Git - php/commitdiff
fixed BUG #8306: shmat() returns -1 on errors, not NULL
authorHartmut Holzgraefe <hholzgra@php.net>
Mon, 18 Dec 2000 12:22:28 +0000 (12:22 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Mon, 18 Dec 2000 12:22:28 +0000 (12:22 +0000)
ext/sysvshm/sysvshm.c

index c28082760ed37dce8f24454fb02fa345a61778d6..67d529603473bdaa46625290123792366ec8f65a 100644 (file)
@@ -125,7 +125,7 @@ PHP_FUNCTION(shm_attach)
                }
        }
 
-       if((shm_ptr = shmat(shm_id,NULL,0))==NULL) {
+       if((shm_ptr = shmat(shm_id,NULL,0))==(void *)-1) {
                php_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno));
                RETURN_FALSE;
        }