]> granicus.if.org Git - apache/commitdiff
Use APR_STATUS_IS_... in some more cases.
authorStefan Fritsch <sf@apache.org>
Wed, 11 May 2011 22:51:46 +0000 (22:51 +0000)
committerStefan Fritsch <sf@apache.org>
Wed, 11 May 2011 22:51:46 +0000 (22:51 +0000)
While this is not strictly necessary everywhere, it makes it much easier
to find the problematic cases.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1102124 13f79535-47bb-0310-9956-ffa450edef68

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

index 2dddb52d92f6ee389d39b6eb7e3cfd7621a4565b..e9ddb6105adb4767ae71ea1c5d342d62ba05c195 100644 (file)
@@ -1846,7 +1846,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
     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) {
index 7271ca17fbba60ac0ad3992905ff656440616152..28026154b6c2c41a84859a8c6d8ed6a660c0215b 100644 (file)
@@ -1371,7 +1371,7 @@ apr_status_t ap_proxygetline(apr_bucket_brigade *bb, char *s, int n, request_rec
 
     if (rv == APR_SUCCESS) {
         *writen = (int) len;
-    } else if (rv == APR_ENOSPC) {
+    } else if (APR_STATUS_IS_ENOSPC(rv)) {
         *writen = n;
     } else {
         *writen = -1;
index eec51719587d6fe69c4dd37c411b934d503a591f..830c7b1aea833ae9f87ec73be345251e436b6424 100644 (file)
@@ -643,7 +643,7 @@ int ap_signal_server(int *exit_status, apr_pool_t *pconf)
 
     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,
index cc256eb88408cde2f3062118220820f83deb7df5..624500830793e03bccda6ec1f9734dec167c4f65 100644 (file)
@@ -610,7 +610,7 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
              * 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 *r, apr_bucket_brigade *bb)
             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;
index 567d0856d7490a401aab8f6bdf47eead25e50937..2e5a7fefaa2905567bec6c938714f85d44cc6d9d 100644 (file)
@@ -1083,7 +1083,7 @@ static apr_status_t remove_directory(apr_pool_t *pool, const char *dir)
     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_pool_t *pool, const char *base,
 
             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_pool_t *pool, const char *base,
 
             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_pool_t *pool, const char *base,
             }
 
             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;
             }
         }
index 46cf7250e27d7f055364ded23ba3ad87311c7686..f9a02bd49cd323bf9dda642cd1b5410ae5c52ebf 100644 (file)
@@ -532,7 +532,7 @@ int main(int argc, const char * const argv[])
     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);
                 }