bjh 99/10/11 07:51:23
Modified: src/lib/apr/file_io/os2 open.c
Log:
OS/2: Implement ap_get_os_file()/ap_put_os_file() and fix ap_open() parameter
order.
Revision Changes Path
1.4 +27 -1 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- open.c 1999/10/06 23:03:44 1.3
+++ open.c 1999/10/11 14:51:22 1.4
@@ -56,6 +56,7 @@
#include "fileio.h"
#include "apr_file_io.h"
#include "apr_lib.h"
+#include "apr_portable.h"
#include <string.h>
#define INCL_DOS
@@ -69,7 +70,7 @@
-ap_status_t ap_open(struct file_t **new, ap_context_t *cntxt, char *fname,
ap_int32_t flag, ap_fileperms_t perm)
+ap_status_t ap_open(struct file_t **new, ap_context_t *cntxt, const char
*fname, ap_int32_t flag, ap_fileperms_t perm)
{
int oflags = 0;
int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE;
@@ -158,4 +159,29 @@
ULONG rc = DosDelete(path);
return os2errno(rc);
}
+
+
+
+ap_status_t ap_get_os_file(ap_os_file_t *thefile, struct file_t *file)
+{
+ if (file == NULL) {
+ return APR_ENOFILE;
+ }
+
+ *thefile = file->filedes;
+ return APR_SUCCESS;
+}
+
+
+
+ap_status_t ap_put_os_file(struct file_t **file, ap_os_file_t *thefile,
ap_context_t *cont)
+{
+ ap_os_file_t *dafile = thefile;
+ if ((*file) == NULL) {
+ (*file) = (struct file_t *)ap_palloc(cont, sizeof(struct file_t));
+ (*file)->cntxt = cont;
+ }
+ (*file)->filedes = *dafile;
+ return APR_SUCCESS;
+}