Commit 7142cb88 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1102124 13f79535-47bb-0310-9956-ffa450edef68
parent 67df9dd7
Loading
Loading
Loading
Loading
+1 −1
Changes for modules/proxy/mod_proxy_ftp.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Changes for modules/proxy/mod_proxy_http.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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;
+1 −1
Changes for server/mpm_unix.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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,
+2 −2
Changes for server/protocol.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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;
+4 −4
Changes for support/htcacheclean.c: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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;
            }
        }
Loading