bjh 00/01/10 06:21:54
Modified: src/lib/apr/file_io/os2 filedup.c fileio.h open.c pipe.c Log: OS/2: Implement delete on close & fix an allocation error in ap_open_stderr. Revision Changes Path 1.5 +1 -0 apache-2.0/src/lib/apr/file_io/os2/filedup.c Index: filedup.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/filedup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- filedup.c 1999/12/19 08:00:28 1.4 +++ filedup.c 2000/01/10 14:21:53 1.5 @@ -89,6 +89,7 @@ dup_file->buffered = old_file->buffered; dup_file->status = old_file->status; dup_file->isopen = old_file->isopen; + dup_file->flags = old_file->flags; if (*new_file == NULL) { ap_register_cleanup(dup_file->cntxt, dup_file, file_cleanup, 1.6 +1 -0 apache-2.0/src/lib/apr/file_io/os2/fileio.h Index: fileio.h =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/fileio.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- fileio.h 1999/12/19 09:41:26 1.5 +++ fileio.h 2000/01/10 14:21:53 1.6 @@ -75,6 +75,7 @@ FILESTATUS3 status; int validstatus; int eof_hit; + ap_int32_t flags; /* Stuff for buffered mode */ char *buffer; 1.13 +12 -4 apache-2.0/src/lib/apr/file_io/os2/open.c Index: open.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/open.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- open.c 1999/12/19 08:05:07 1.12 +++ open.c 2000/01/10 14:21:53 1.13 @@ -84,6 +84,7 @@ dafile->validstatus = FALSE; dafile->eof_hit = FALSE; dafile->buffer = NULL; + dafile->flags = flag; if ((flag & APR_READ) && (flag & APR_WRITE)) { mflags |= OPEN_ACCESS_READWRITE; @@ -148,7 +149,8 @@ ap_status_t ap_close(ap_file_t *file) { - ULONG rc; + ULONG rc; + ap_status_t status; if (file && file->isopen) { ap_flush(file); @@ -156,12 +158,16 @@ if (rc == 0) { file->isopen = FALSE; - return APR_SUCCESS; + status = APR_SUCCESS; + + if (file->flags & APR_DELONCLOSE) { + status = os2errno(DosDelete(file->fname)); + } } else { return os2errno(rc); } } - + return APR_SUCCESS; } @@ -199,6 +205,7 @@ (*file)->buffered = FALSE; (*file)->validstatus = FALSE; (*file)->eof_hit = FALSE; + (*file)->flags = 0; return APR_SUCCESS; } @@ -216,7 +223,7 @@ ap_status_t ap_open_stderr(struct file_t **thefile, ap_context_t *cont) { - (*thefile) = ap_palloc(cont, sizeof(ap_file_t *)); + (*thefile) = ap_palloc(cont, sizeof(struct file_t)); if ((*thefile) == NULL) { return APR_ENOMEM; } @@ -227,6 +234,7 @@ (*thefile)->buffered = FALSE; (*thefile)->validstatus = FALSE; (*thefile)->eof_hit = FALSE; + (*thefile)->flags = 0; return APR_SUCCESS; } 1.6 +2 -0 apache-2.0/src/lib/apr/file_io/os2/pipe.c Index: pipe.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/pipe.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- pipe.c 1999/10/19 15:24:19 1.5 +++ pipe.c 2000/01/10 14:21:54 1.6 @@ -76,6 +76,7 @@ (*in)->fname = ap_pstrdup(cont, "PIPE"); (*in)->isopen = TRUE; (*in)->buffered = FALSE; + (*in)->flags = 0; ap_register_cleanup(cont, *in, file_cleanup, ap_null_cleanup); (*out) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t)); @@ -84,6 +85,7 @@ (*out)->fname = ap_pstrdup(cont, "PIPE"); (*out)->isopen = TRUE; (*out)->buffered = FALSE; + (*out)->flags = 0; ap_register_cleanup(cont, *out, file_cleanup, ap_null_cleanup); return APR_SUCCESS;