summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2011-05-16 16:58:02 +0000
committerRasmus Lerdorf <rasmus@php.net>2011-05-16 16:58:02 +0000
commit75ec1fedc7532b4743bedc1ec4881d90b7d71452 (patch)
treefe00077f710f0f357548deb62f9c82d63bfb270b /main/main.c
parent27dd44db9577f09864cb231b0e1e58efe9a14230 (diff)
downloadphp-git-75ec1fedc7532b4743bedc1ec4881d90b7d71452.tar.gz
Add php_ignore_value() macro to suppress unused return value warnings
from gcc. There are times when we really don't care about the return value and this will cleanly tell gcc.
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/main.c b/main/main.c
index b8f89badad..9a068dfbae 100644
--- a/main/main.c
+++ b/main/main.c
@@ -561,7 +561,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
#ifdef PHP_WIN32
php_flock(fd, 2);
#endif
- write(fd, tmp, len);
+ php_ignore_value(write(fd, tmp, len));
efree(tmp);
efree(error_time_str);
close(fd);
@@ -2301,7 +2301,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
/* this looks nasty to me */
old_cwd_fd = open(".", 0);
#else
- VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
+ php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1));
#endif
VCWD_CHDIR_FILE(primary_file->filename);
}
@@ -2360,7 +2360,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
}
#else
if (old_cwd[0] != '\0') {
- VCWD_CHDIR(old_cwd);
+ php_ignore_value(VCWD_CHDIR(old_cwd));
}
free_alloca(old_cwd, use_heap);
#endif
@@ -2390,14 +2390,14 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret
PG(during_request_startup) = 0;
if (primary_file->filename && !(SG(options) & SAPI_OPTION_NO_CHDIR)) {
- VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
+ php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1));
VCWD_CHDIR_FILE(primary_file->filename);
}
zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
} zend_end_try();
if (old_cwd[0] != '\0') {
- VCWD_CHDIR(old_cwd);
+ php_ignore_value(VCWD_CHDIR(old_cwd));
}
free_alloca(old_cwd, use_heap);