]> granicus.if.org Git - php/commitdiff
Correctly check for the existence of the st_rdev field.
authorSascha Schumann <sas@php.net>
Wed, 21 Feb 2001 07:18:28 +0000 (07:18 +0000)
committerSascha Schumann <sas@php.net>
Wed, 21 Feb 2001 07:18:28 +0000 (07:18 +0000)
Note that this field is required to exist for SUSv3 conformance.

Submitted by: amra@us.ibm.com
PR: #9358

ext/standard/file.c
ext/standard/filestat.c

index e264e94995af8c3005dd0dd0ab013e7a4376ec16..6f8b05e351a1bc1e4e7aed6ef1d497ba6fd9bffc 100644 (file)
@@ -1624,8 +1624,10 @@ PHP_NAMED_FUNCTION(php_if_fstat)
        add_assoc_long ( return_value , "uid" , stat_sb.st_uid );
        add_assoc_long ( return_value , "gid" , stat_sb.st_gid );
 
-#ifdef HAVE_ST_BLKSIZE
+#ifdef HAVE_ST_RDEV
        add_assoc_long ( return_value, "rdev" , stat_sb.st_rdev );
+#endif
+#ifdef HAVE_ST_BLKSIZE
        add_assoc_long ( return_value , "blksize" , stat_sb.st_blksize );
 #endif
        
index 92cbee6e7988c20bd0deccbb78084fea51260a6c..819841f82a18ebec1e3f7244a26319c68b069a36 100644 (file)
@@ -593,7 +593,7 @@ static void php_stat(const char *filename, int type, pval *return_value)
                add_next_index_long(return_value, stat_sb->st_nlink);
                add_next_index_long(return_value, stat_sb->st_uid);
                add_next_index_long(return_value, stat_sb->st_gid);
-#ifdef HAVE_ST_BLKSIZE
+#ifdef HAVE_ST_RDEV
                add_next_index_long(return_value, stat_sb->st_rdev);
 #else
                add_next_index_long(return_value, -1);