You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/05/12 00:51:47 UTC
svn commit: r1102124 - in /httpd/httpd/trunk: modules/proxy/mod_proxy_ftp.c
modules/proxy/mod_proxy_http.c server/mpm_unix.c server/protocol.c
support/htcacheclean.c support/htdbm.c
Author: sf
Date: Wed May 11 22:51:46 2011
New Revision: 1102124
URL: http://svn.apache.org/viewvc?rev=1102124&view=rev
Log:
Use APR_STATUS_IS_... in some more cases.
While this is not strictly necessary everywhere, it makes it much easier
to find the problematic cases.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
httpd/httpd/trunk/server/mpm_unix.c
httpd/httpd/trunk/server/protocol.c
httpd/httpd/trunk/support/htcacheclean.c
httpd/httpd/trunk/support/htdbm.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Wed May 11 22:51:46 2011
@@ -1846,7 +1846,7 @@ static int proxy_ftp_handler(request_rec
if (use_port) {
for (;;) {
rv = apr_socket_accept(&data_sock, local_sock, r->pool);
- if (rv == APR_EINTR) {
+ if (APR_STATUS_IS_EINTR(rv)) {
continue;
}
else if (rv == APR_SUCCESS) {
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Wed May 11 22:51:46 2011
@@ -1371,7 +1371,7 @@ apr_status_t ap_proxygetline(apr_bucket_
if (rv == APR_SUCCESS) {
*writen = (int) len;
- } else if (rv == APR_ENOSPC) {
+ } else if (APR_STATUS_IS_ENOSPC(rv)) {
*writen = n;
} else {
*writen = -1;
Modified: httpd/httpd/trunk/server/mpm_unix.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_unix.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_unix.c (original)
+++ httpd/httpd/trunk/server/mpm_unix.c Wed May 11 22:51:46 2011
@@ -643,7 +643,7 @@ int ap_signal_server(int *exit_status, a
rv = ap_read_pid(pconf, ap_pid_fname, &otherpid);
if (rv != APR_SUCCESS) {
- if (rv != APR_ENOENT) {
+ if (!APR_STATUS_IS_ENOENT(rv)) {
ap_log_error(APLOG_MARK, APLOG_STARTUP, rv, NULL,
"Error retrieving pid file %s", ap_pid_fname);
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/protocol.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Wed May 11 22:51:46 2011
@@ -610,7 +610,7 @@ static int read_request_line(request_rec
* buffer before finding the end-of-line. This is only going to
* happen if it exceeds the configured limit for a request-line.
*/
- if (rv == APR_ENOSPC) {
+ if (APR_STATUS_IS_ENOSPC(rv)) {
r->status = HTTP_REQUEST_URI_TOO_LARGE;
r->proto_num = HTTP_VERSION(1,0);
r->protocol = apr_pstrdup(r->pool, "HTTP/1.0");
@@ -618,7 +618,7 @@ static int read_request_line(request_rec
else if (APR_STATUS_IS_TIMEUP(rv)) {
r->status = HTTP_REQUEST_TIME_OUT;
}
- else if (rv == APR_EINVAL) {
+ else if (APR_STATUS_IS_EINVAL(rv)) {
r->status = HTTP_BAD_REQUEST;
}
return 0;
Modified: httpd/httpd/trunk/support/htcacheclean.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htcacheclean.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/support/htcacheclean.c (original)
+++ httpd/httpd/trunk/support/htcacheclean.c Wed May 11 22:51:46 2011
@@ -1083,7 +1083,7 @@ static apr_status_t remove_directory(apr
apr_finfo_t dirent;
rv = apr_dir_open(&dirp, dir, pool);
- if (rv == APR_ENOENT) {
+ if (APR_STATUS_IS_ENOENT(rv)) {
return rv;
}
if (rv != APR_SUCCESS) {
@@ -1193,7 +1193,7 @@ static apr_status_t find_directory(apr_p
remove = apr_pstrcat(pool, base, "/", header, NULL);
status = apr_file_remove(remove, pool);
- if (status != APR_SUCCESS && status != APR_ENOENT) {
+ if (status != APR_SUCCESS && !APR_STATUS_IS_ENOENT(status)) {
char errmsg[120];
apr_file_printf(errfile, "Could not remove file %s: %s" APR_EOL_STR,
remove, apr_strerror(status, errmsg, sizeof errmsg));
@@ -1202,7 +1202,7 @@ static apr_status_t find_directory(apr_p
remove = apr_pstrcat(pool, base, "/", data, NULL);
status = apr_file_remove(remove, pool);
- if (status != APR_SUCCESS && status != APR_ENOENT) {
+ if (status != APR_SUCCESS && !APR_STATUS_IS_ENOENT(status)) {
char errmsg[120];
apr_file_printf(errfile, "Could not remove file %s: %s" APR_EOL_STR,
remove, apr_strerror(status, errmsg, sizeof errmsg));
@@ -1210,7 +1210,7 @@ static apr_status_t find_directory(apr_p
}
status = remove_directory(pool, apr_pstrcat(pool, base, "/", vdir, NULL));
- if (status != APR_SUCCESS && status != APR_ENOENT) {
+ if (status != APR_SUCCESS && !APR_STATUS_IS_ENOENT(status)) {
rv = status;
}
}
Modified: httpd/httpd/trunk/support/htdbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htdbm.c?rev=1102124&r1=1102123&r2=1102124&view=diff
==============================================================================
--- httpd/httpd/trunk/support/htdbm.c (original)
+++ httpd/httpd/trunk/support/htdbm.c Wed May 11 22:51:46 2011
@@ -532,7 +532,7 @@ int main(int argc, const char * const ar
switch (cmd) {
case HTDBM_VERIFY:
if ((rv = htdbm_verify(h)) != APR_SUCCESS) {
- if(rv == APR_ENOENT) {
+ if (APR_STATUS_IS_ENOENT(rv)) {
fprintf(stderr, "The user '%s' could not be found in database\n", h->username);
exit(ERR_BADUSER);
}