From: Ryan Bloom Date: Wed, 6 Oct 1999 23:04:16 +0000 (+0000) Subject: Bring file_io up to the new parameter order for APR. I have decided to do X-Git-Tag: 1.3.10~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e75cbac28ccc264af9fc1e5dde90764e04a9a553;p=thirdparty%2Fapache%2Fhttpd.git Bring file_io up to the new parameter order for APR. I have decided to do these on a directory by directory basis for the rest of APR. I hope to cause fewer problems for other developers by doing it this way. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83937 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index 9db8ced4aa8..f305b4a95a0 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -86,7 +86,7 @@ static int asis_handler(request_rec *r) return FORBIDDEN; } - ap_get_os_file(f, &thefd); + ap_get_os_file(&thefd, f); thefile = fdopen(thefd, "r"); ap_scan_script_header_err(r, thefile, NULL); diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 0b4151bf28e..660565d2e36 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -1513,7 +1513,7 @@ static int index_directory(request_rec *r, char keyid; char direction; - if (ap_opendir(&d, r->pool, name) != APR_SUCCESS) { + if (ap_opendir(&d, name, r->pool) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, r, "Can't open directory for index: %s", r->filename); return HTTP_FORBIDDEN; diff --git a/modules/http/http_core.c b/modules/http/http_core.c index c1b23789b24..682b08284fc 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -2521,7 +2521,7 @@ static int default_handler(request_rec *r) return FORBIDDEN; } else - ap_get_os_file (fd, &fd_os); + ap_get_os_file(&fd_os, fd); ap_update_mtime(r, r->finfo.st_mtime); ap_set_last_modified(r); diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index d2d75c5b312..5b6beab74e9 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -644,7 +644,7 @@ static enum header_state get_header_line(char *buffer, int len, ap_file_t *map) /* Get a noncommented line */ do { - if (ap_fgets(map, buffer, MAX_STRING_LEN) != APR_SUCCESS) { + if (ap_fgets(buffer, MAX_STRING_LEN, map) != APR_SUCCESS) { return header_eof; } } while (buffer[0] == '#'); @@ -665,10 +665,10 @@ static enum header_state get_header_line(char *buffer, int len, ap_file_t *map) cp += strlen(cp); - while (ap_getc(map, &c) != APR_EOF) { + while (ap_getc(&c, map) != APR_EOF) { if (c == '#') { /* Comment line */ - while (ap_getc(map, &c) != EOF && c != '\n') { + while (ap_getc(&c, map) != EOF && c != '\n') { continue; } } @@ -679,11 +679,11 @@ static enum header_state get_header_line(char *buffer, int len, ap_file_t *map) */ while (c != '\n' && ap_isspace(c)) { - if(ap_getc(map, &c) != APR_SUCCESS) + if(ap_getc(&c, map) != APR_SUCCESS) break; } - ap_ungetc(map, c); + ap_ungetc(c, map); if (c == '\n') { return header_seen; /* Blank line */ @@ -691,7 +691,7 @@ static enum header_state get_header_line(char *buffer, int len, ap_file_t *map) /* Continuation */ - while (cp < buf_end - 2 && (ap_getc(map, &c)) != EOF && c != '\n') { + while (cp < buf_end - 2 && (ap_getc(&c, map)) != EOF && c != '\n') { *cp++ = c; } @@ -702,7 +702,7 @@ static enum header_state get_header_line(char *buffer, int len, ap_file_t *map) /* Line beginning with something other than whitespace */ - ap_ungetc(map, c); + ap_ungetc(c, map); return header_seen; } } @@ -908,7 +908,7 @@ static int read_types_multi(negotiation_state *neg) ++filp; prefix_len = strlen(filp); - if (ap_opendir(&dirp, neg->pool, neg->dir_name) != APR_SUCCESS) { + if (ap_opendir(&dirp, neg->dir_name, neg->pool) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, r, "cannot read directory for multi: %s", neg->dir_name); return HTTP_FORBIDDEN; diff --git a/server/log.c b/server/log.c index f9f7cc844c9..31d7f3fff04 100644 --- a/server/log.c +++ b/server/log.c @@ -258,7 +258,7 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p) if (s_main->error_log) { /* replace stderr with this new log */ fflush(stderr); - ap_get_os_file(s_main->error_log, &errfile); + ap_get_os_file(&errfile, s_main->error_log); if (dup2(errfile, STDERR_FILENO) == -1) { ap_log_error(APLOG_MARK, APLOG_CRIT, s_main, "unable to replace stderr with error_log"); @@ -295,7 +295,7 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p) API_EXPORT(void) ap_error_log2stderr(server_rec *s) { int errfile; - ap_get_os_file(s->error_log, &errfile); + ap_get_os_file(&errfile, s->error_log); if ( s->error_log != NULL && errfile != STDERR_FILENO) dup2(errfile, STDERR_FILENO); @@ -458,8 +458,8 @@ static void log_error_core(const char *file, int line, int level, if (logf) { /* ZZZ let's just use AP funcs to Write to the error log. If failure, can we output a message to the console??? */ - ap_puts(logf, errstr); - ap_putc(logf, '\n'); + ap_puts(errstr, logf); + ap_putc('\n', logf); ap_flush(logf); } #ifdef HAVE_SYSLOG diff --git a/server/mpm/mpmt_pthread/scoreboard.c b/server/mpm/mpmt_pthread/scoreboard.c index 3992439f48a..8459af49b7c 100644 --- a/server/mpm/mpmt_pthread/scoreboard.c +++ b/server/mpm/mpmt_pthread/scoreboard.c @@ -454,7 +454,7 @@ API_EXPORT(void) reopen_scoreboard(ap_context_t *p) ap_open(p, ap_scoreboard_fname, APR_CREATE | APR_BINARY | APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD | APR_GWRITE | APR_WREAD | APR_WWRITE, &scoreboard_file); - ap_get_os_file(scoreboard_file, &scoreboard_fd); + ap_get_os_file(&scoreboard_fd, scoreboard_file); if (scoreboard_fd == -1) { perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); @@ -482,7 +482,7 @@ void reinit_scoreboard(ap_context_t *p) ap_open(p, ap_scoreboard_fname, APR_CREATE | APR_BINARY | APR_READ | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, &scoreboard_file); - ap_get_os_file(scoreboard_file, &scoreboard_fd); + ap_get_os_file(&scoreboard_fd, scoreboard_file); if (scoreboard_fd == -1) { perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 478cacc5fdb..ef27132e291 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -544,7 +544,7 @@ static void accept_mutex_init(ap_context_t *p) expand_lock_fname(p); ap_open(&tempfile, p, ap_lock_fname, APR_CREATE | APR_WRITE | APR_EXCL, APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD); - ap_get_os_file(tempfile, &lock_fd); + ap_get_os_file(&lock_fd, tempfile); if (lock_fd == -1) { perror("open"); fprintf(stderr, "Cannot open lock file: %s\n", ap_lock_fname); @@ -611,7 +611,7 @@ static void accept_mutex_child_init(ap_context_t *p) "Child cannot open lock file: %s", ap_lock_fname); clean_child_exit(APEXIT_CHILDINIT); } - ap_get_os_file(tempfile, &lock_fd); + ap_get_os_file(&lock_fd, tempfile); } /* @@ -631,7 +631,7 @@ static void accept_mutex_init(ap_context_t *p) "Parent cannot open lock file: %s", ap_lock_fname); exit(APEXIT_INIT); } - ap_get_os_file(tempfile, &lock_fd); + ap_get_os_file(&lock_fd, tempfile); ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup); } diff --git a/server/util.c b/server/util.c index 421db3fb07a..9900793ee55 100644 --- a/server/util.c +++ b/server/util.c @@ -841,7 +841,7 @@ static int cfg_getch(void *param) { char ch; ap_file_t *cfp = (ap_file_t *) param; - if (ap_getc(cfp, &ch) == APR_SUCCESS) + if (ap_getc(&ch, cfp) == APR_SUCCESS) return ch; return (int)EOF; } @@ -849,7 +849,7 @@ static int cfg_getch(void *param) static void *cfg_getstr(void *buf, size_t bufsiz, void *param) { ap_file_t *cfp = (ap_file_t *) param; - if (ap_fgets(cfp, buf, bufsiz) == APR_SUCCESS) + if (ap_fgets(buf, bufsiz, cfp) == APR_SUCCESS) return buf; return NULL; } @@ -888,7 +888,7 @@ API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name) if (stat != APR_SUCCESS) return NULL; - if (ap_get_filetype(file, &type) == APR_SUCCESS && + if (ap_get_filetype(&type, file) == APR_SUCCESS && type != APR_REG && #if defined(WIN32) || defined(OS2) !(strcasecmp(name, "nul") == 0 ||