You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Victor J. Orlikowski" <v....@gte.net> on 2000/11/10 16:37:05 UTC
[PATCH] AIX/xlC type fixes
A spate of types fixes to get AIX building again. These come as a
result of the bucket apr_ssize_t/apr_size_t transition.
Index: src/ap/ap_buckets.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/ap/ap_buckets.c,v
retrieving revision 1.30
diff -u -d -b -r1.30 ap_buckets.c
--- ap_buckets.c 2000/11/07 20:21:05 1.30
+++ ap_buckets.c 2000/11/10 15:34:14
@@ -142,7 +142,7 @@
ap_bucket *r;
const char *x;
int j, k;
- apr_ssize_t i;
+ apr_size_t i;
for (k = 0;;) {
x = va_arg(va, const char *);
Index: src/ap/ap_cache.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/ap/ap_cache.c,v
retrieving revision 1.9
diff -u -d -b -r1.9 ap_cache.c
--- ap_cache.c 2000/09/10 20:45:15 1.9
+++ ap_cache.c 2000/11/10 15:34:14
@@ -187,7 +187,7 @@
apr_file_t *place;
char buffer[HUGE_STRING_LEN];
apr_status_t ret = APR_SUCCESS;
- apr_ssize_t nbytes, i, o;
+ apr_size_t nbytes, i, o;
if((ret = ap_cache_el_data(el, &place)) != APR_SUCCESS) return ret;
nbytes = HUGE_STRING_LEN;
Index: src/include/buff.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/include/buff.h,v
retrieving revision 1.37
diff -u -d -b -r1.37 buff.h
--- buff.h 2000/10/16 06:04:33 1.37
+++ buff.h 2000/11/10 15:34:14
@@ -150,7 +150,7 @@
on an unbuffered stream, shouldn't change
the saved error from I/O */
unsigned char *inptr; /* pointer to next location to read */
- apr_ssize_t incnt; /* number of bytes left to read from input buffer;
+ apr_size_t incnt; /* number of bytes left to read from input buffer;
* always 0 if had a read error */
int outchunk; /* location of chunk header when chunking */
int outcnt; /* number of byte put in output buffer */
@@ -243,7 +243,7 @@
* bytes to have been read even if an error (or APR_EOF) is returned.
*/
AP_DECLARE(apr_status_t) ap_bread_core(BUFF *fb, void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_read);
+ apr_size_t *bytes_read);
AP_DECLARE(int) ap_bgets(char *s, int n, BUFF *fb);
AP_DECLARE(int) ap_blookc(BUFF *fb);
/* write bytes from the specified buffer.
@@ -251,7 +251,7 @@
* for both an error to be returned, and bytes to have been written.
*/
AP_DECLARE(apr_status_t) ap_bwrite_core(BUFF *fb, const void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_written);
+ apr_size_t *bytes_written);
#ifdef APACHE_XLATE
#define ap_bwrite(fb,buf,nbyte,bytes_written) \
(fb)->b_write_ops.bwrite(fb,buf,nbyte,bytes_written)
Index: src/lib/apr/file_io/unix/fullrw.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/file_io/unix/fullrw.c,v
retrieving revision 1.3
diff -u -d -b -r1.3 fullrw.c
--- fullrw.c 2000/08/02 05:25:51 1.3
+++ fullrw.c 2000/11/10 15:34:14
@@ -62,7 +62,7 @@
apr_size_t total_read = 0;
do {
- apr_ssize_t amt = (apr_ssize_t)nbytes;
+ apr_size_t amt = nbytes;
status = apr_read(thefile, buf, &amt);
buf = (char *)buf + amt;
@@ -83,7 +83,7 @@
apr_size_t total_written = 0;
do {
- apr_ssize_t amt = (apr_ssize_t)nbytes;
+ apr_size_t amt = nbytes;
status = apr_write(thefile, buf, &amt);
buf = (char *)buf + amt;
Index: src/main/buff.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/main/buff.c,v
retrieving revision 1.68
diff -u -d -b -r1.68 buff.c
--- buff.c 2000/11/09 02:35:11 1.68
+++ buff.c 2000/11/10 15:34:14
@@ -353,7 +353,7 @@
/* read without blocking, if EAGAIN, then flush */
static apr_status_t saferead(BUFF *fb, void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_read)
+ apr_size_t *bytes_read)
{
int rv;
const int zero = 0;
@@ -401,7 +401,7 @@
/* a wrapper around apr_recv which checks for errors and EOFs */
static apr_status_t read_with_errors(BUFF *fb, void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_read)
+ apr_size_t *bytes_read)
{
apr_status_t rv = APR_EINIT;
@@ -459,10 +459,10 @@
* If fewer than nbyte bytes are currently available, then return those.
*/
AP_DECLARE(apr_status_t) ap_bread_core(BUFF *fb, void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_read)
+ apr_size_t *bytes_read)
{
int nrd;
- apr_ssize_t i;
+ apr_size_t i;
apr_status_t rv;
if (fb->flags & B_RDERR) {
@@ -559,7 +559,7 @@
AP_DECLARE(int) ap_bgets(char *buff, int n, BUFF *fb)
{
int ch, ct;
- apr_ssize_t i;
+ apr_size_t i;
apr_status_t rv;
/* Can't do bgets on an unbuffered stream */
@@ -653,7 +653,7 @@
AP_DECLARE(int) ap_bflsbuf(int c, BUFF *fb)
{
char ss[1];
- apr_ssize_t bytes_written;
+ apr_size_t bytes_written;
apr_status_t rv;
ss[0] = c;
@@ -671,7 +671,7 @@
AP_DECLARE(int) ap_bfilbuf(BUFF *fb)
{
apr_status_t rv;
- apr_ssize_t i;
+ apr_size_t i;
char buf[1];
rv = ap_bread(fb, buf, 1, &i);
@@ -687,7 +687,7 @@
* bytes_sent.
*/
static apr_status_t writev_with_errors(BUFF *fb, const struct iovec *vec,
- int nvec, apr_ssize_t *bytes_written)
+ int nvec, apr_size_t *bytes_written)
{
apr_status_t rv;
rv = apr_sendv(fb->bsock, vec, nvec, bytes_written);
@@ -704,11 +704,11 @@
static apr_status_t writev_it_all(BUFF *fb, struct iovec *vec, int nvec,
- apr_ssize_t *bytes_written)
+ apr_size_t *bytes_written)
{
int i;
apr_status_t rv;
- apr_ssize_t n;
+ apr_size_t n;
i = 0;
*bytes_written = 0;
@@ -745,7 +745,7 @@
doesn't include any bytes potentially written from fb->outbase.
*/
static apr_status_t large_write(BUFF *fb, const char *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_written)
+ apr_size_t *bytes_written)
{
struct iovec vec[2];
int nvec;
@@ -810,7 +810,7 @@
-djg
*/
static apr_status_t large_write_chunk(BUFF *fb, const char *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_written)
+ apr_size_t *bytes_written)
{
return large_write(fb, buf, nbyte, bytes_written);
}
@@ -819,7 +819,7 @@
* bytes_sent.
*/
static apr_status_t write_with_errors(BUFF *fb, const void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_written)
+ apr_size_t *bytes_written)
{
apr_status_t rv;
@@ -840,7 +840,7 @@
static apr_status_t bflush_core(BUFF *fb, apr_ssize_t *bytes_written)
{
apr_status_t rv;
- apr_ssize_t n;
+ apr_size_t n;
if (fb->flags & B_CHUNK) {
end_chunk(fb, 0);
@@ -994,7 +994,7 @@
* state.
*/
AP_DECLARE(apr_status_t) ap_bwrite_core(BUFF *fb, const void *buf, apr_size_t nbyte,
- apr_ssize_t *bytes_written)
+ apr_size_t *bytes_written)
{
int amt;
int total;
@@ -1124,7 +1124,7 @@
{
apr_status_t rv;
int j = strlen(x);
- apr_ssize_t i;
+ apr_size_t i;
rv = ap_bwrite(fb, x, j, &i);
if (i != j) {
fb->berrno = rv;
@@ -1140,7 +1140,7 @@
AP_DECLARE(int) ap_vbputstrs(BUFF *fb, va_list va)
{
int j, k;
- apr_ssize_t i;
+ apr_size_t i;
const char *x;
int rv;
Index: src/modules/mpm/dexter/dexter.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.129
diff -u -d -b -r1.129 dexter.c
--- dexter.c 2000/10/23 10:54:14 1.129
+++ dexter.c 2000/11/10 15:34:14
@@ -474,7 +474,7 @@
if (!workers_may_exit) {
int ret;
char pipe_read_char;
- apr_ssize_t n = 1;
+ apr_size_t n = 1;
ret = apr_recv(listenfds[0], &pipe_read_char, &n);
if (APR_STATUS_IS_EAGAIN(ret)) {
@@ -977,7 +977,7 @@
int remaining_children_to_start;
int i;
apr_status_t rv;
- apr_ssize_t one = 1;
+ apr_size_t one = 1;
pconf = _pconf;
ap_server_conf = s;
Index: src/modules/mpm/mpmt_pthread/mpmt_pthread.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.124
diff -u -d -b -r1.124 mpmt_pthread.c
--- mpmt_pthread.c 2000/10/23 10:54:15 1.124
+++ mpmt_pthread.c 2000/11/10 15:34:15
@@ -426,7 +426,7 @@
if (!workers_may_exit) {
apr_status_t ret;
char pipe_read_char;
- apr_ssize_t n = 1;
+ apr_size_t n = 1;
ret = apr_recv(listensocks[0], &pipe_read_char, &n);
if (APR_STATUS_IS_EAGAIN(ret)) {
@@ -711,6 +711,7 @@
sigemptyset(&sig_mask);
sigaddset(&sig_mask, SIGTERM);
sigaddset(&sig_mask, SIGINT);
+ sigaddset(&sig_mask, SIGTRAP);
ap_sigwait(&sig_mask, &signal_received);
switch (signal_received) {
case SIGTERM:
@@ -822,7 +823,7 @@
int free_slots[MAX_SPAWN_RATE];
int last_non_dead;
int total_non_dead;
- apr_ssize_t one = 1;
+ apr_size_t one = 1;
apr_status_t rv;
/* initialize the free_list */
@@ -998,7 +999,7 @@
{
int remaining_children_to_start;
apr_status_t rv;
- apr_ssize_t one = 1;
+ apr_size_t one = 1;
pconf = _pconf;
ap_server_conf = s;
Index: src/modules/mpm/perchild/perchild.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/mpm/perchild/perchild.c,v
retrieving revision 1.24
diff -u -d -b -r1.24 perchild.c
--- perchild.c 2000/10/23 10:54:16 1.24
+++ perchild.c 2000/11/10 15:34:15
@@ -512,7 +512,7 @@
if (!workers_may_exit) {
int ret;
char pipe_read_char;
- apr_ssize_t n = 1;
+ apr_size_t n = 1;
ret = apr_recv(listenfds[0], &pipe_read_char, &n);
if (APR_STATUS_IS_EAGAIN(ret)) {
@@ -1138,7 +1138,7 @@
int remaining_children_to_start;
int i;
apr_status_t rv;
- apr_ssize_t one = 1;
+ apr_size_t one = 1;
pconf = _pconf;
ap_server_conf = s;
Index: src/modules/standard/mod_autoindex.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.45
diff -u -d -b -r1.45 mod_autoindex.c
--- mod_autoindex.c 2000/11/02 20:01:52 1.45
+++ mod_autoindex.c 2000/11/10 15:34:15
@@ -912,7 +912,7 @@
{
char buf[IOBUFSIZE + 1];
int i, c, ch;
- apr_ssize_t n;
+ apr_size_t n;
apr_status_t stat;
ap_rputs("<PRE>\n", r);
@@ -1106,7 +1106,7 @@
char titlebuf[MAX_STRING_LEN], *find = "<TITLE>";
apr_file_t *thefile = NULL;
int x, y, p;
- apr_ssize_t n;
+ apr_size_t n;
if (r->status != HTTP_OK) {
return NULL;
Index: src/modules/standard/mod_cgid.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_cgid.c,v
retrieving revision 1.48
diff -u -d -b -r1.48 mod_cgid.c
--- mod_cgid.c 2000/10/23 15:30:53 1.48
+++ mod_cgid.c 2000/11/10 15:34:15
@@ -745,7 +745,7 @@
char **env;
struct sockaddr_un unix_addr;
apr_file_t *tempsock = NULL;
- apr_ssize_t nbytes;
+ apr_size_t nbytes;
if (r->method_number == M_OPTIONS) {
/* 99 out of 100 cgid scripts, this is all they support */
Index: src/modules/standard/mod_include.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_include.c,v
retrieving revision 1.73
diff -u -d -b -r1.73 mod_include.c
--- mod_include.c 2000/10/24 18:40:00 1.73
+++ mod_include.c 2000/11/10 15:34:15
@@ -185,7 +185,7 @@
static ap_bucket *find_string(ap_bucket *dptr, const char *str, ap_bucket *end)
{
- apr_ssize_t len;
+ apr_size_t len;
const char *c;
const char *buf;
int state = 0;
@@ -341,7 +341,7 @@
ap_bucket *dptr = in;
const char *c;
const char *str;
- apr_ssize_t length;
+ apr_size_t length;
char *t = tag, *tag_val, term;
/* makes code below a little less cluttered */
@@ -475,7 +475,7 @@
char *d = dest;
const char *c;
const char *str;
- apr_ssize_t length;
+ apr_size_t length;
/* make room for nul terminator */
--len;
Index: src/modules/standard/mod_log_config.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_log_config.c,v
retrieving revision 1.40
diff -u -d -b -r1.40 mod_log_config.c
--- mod_log_config.c 2000/11/07 00:58:49 1.40
+++ mod_log_config.c 2000/11/10 15:34:16
@@ -255,7 +255,7 @@
apr_file_t *log_fd;
char *condition_var;
#ifdef BUFFERED_LOGS
- apr_ssize_t outcnt;
+ apr_size_t outcnt;
char outbuf[LOG_BUFSIZE];
#endif
} config_log_state;
@@ -828,7 +828,7 @@
int *strl;
request_rec *orig;
int i;
- apr_ssize_t len = 0;
+ apr_size_t len = 0;
apr_array_header_t *format;
char *envar;
@@ -881,7 +881,7 @@
flush_log(cls);
}
if (len >= LOG_BUFSIZE) {
- apr_ssize_t w;
+ apr_size_t w;
str = apr_palloc(r->pool, len + 1);
for (i = 0, s = str; i < format->nelts; ++i) {
Index: src/support/ab.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/support/ab.c,v
retrieving revision 1.31
diff -u -d -b -r1.31 ab.c
--- ab.c 2000/11/08 18:41:45 1.31
+++ ab.c 2000/11/10 15:34:16
@@ -183,7 +183,7 @@
char path[1024]; /* path name */
char postfile[1024]; /* name of file containing post data */
char *postdata; /* *buffer containing data from postfile */
-apr_ssize_t postlen = 0; /* length of data to be POSTed */
+apr_size_t postlen = 0; /* length of data to be POSTed */
char content_type[1024]; /* content type to put in POST header */
char cookie[1024], /* optional cookie line */
auth[1024], /* optional (basic/uuencoded)
@@ -214,7 +214,7 @@
/* global request (and its length) */
char request[512];
-apr_ssize_t reqlen;
+apr_size_t reqlen;
/* one global throw-away buffer to read stuff into */
char buffer[8192];
@@ -258,7 +258,7 @@
static void write_request(struct connection *c)
{
- apr_ssize_t len = reqlen;
+ apr_size_t len = reqlen;
c->connect = apr_now();
apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, aprtimeout);
if (apr_send(c->aprsock, request, &reqlen) != APR_SUCCESS ||
@@ -569,7 +569,7 @@
static void read_connection(struct connection *c)
{
- apr_ssize_t r;
+ apr_size_t r;
apr_status_t status;
char *part;
char respcode[4]; /* 3 digits and null */
@@ -956,7 +956,7 @@
apr_file_t *postfd = NULL;
apr_finfo_t finfo;
apr_fileperms_t mode = APR_OS_DEFAULT;
- apr_ssize_t length;
+ apr_size_t length;
if (apr_open(&postfd, pfile, APR_READ, mode, cntxt) != APR_SUCCESS) {
printf("Invalid postfile name (%s)\n", pfile);
Victor
--
Victor J. Orlikowski
======================
v.j.orlikowski@gte.net
vjo@raleigh.ibm.com
vjo@us.ibm.com