From 47f7795594af4a3b3eaaac9fad2f813a514e0e2d Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 21 Feb 2001 07:18:28 +0000 Subject: Correctly check for the existence of the st_rdev field. Note that this field is required to exist for SUSv3 conformance. Submitted by: amra@us.ibm.com PR: #9358 --- ext/standard/file.c | 4 +++- ext/standard/filestat.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/standard/file.c b/ext/standard/file.c index e264e94995..6f8b05e351 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -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 diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 92cbee6e79..819841f82a 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -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); -- cgit v1.2.1