You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bj...@locus.apache.org on 2000/04/19 18:26:34 UTC

cvs commit: apache-2.0/src/lib/apr/file_io/os2 Makefile.in maperrorcode.c

bjh         00/04/19 09:26:34

  Modified:    src/lib/apr/file_io/os2 Makefile.in maperrorcode.c
  Log:
  Turn os2errno into OS/2 version of ap_canonical_error().
  
  Revision  Changes    Path
  1.8       +2 -1      apache-2.0/src/lib/apr/file_io/os2/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/Makefile.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile.in	2000/04/08 06:58:39	1.7
  +++ Makefile.in	2000/04/19 16:26:33	1.8
  @@ -21,7 +21,8 @@
   	open.o \
   	pipe.o \
   	readwrite.o \
  -	seek.o
  +	seek.o \
  +	maperrorcode.o
   
   .c.o:
   	$(CC) $(CFLAGS) -c $(INCLUDES) $<
  
  
  
  1.7       +12 -3     apache-2.0/src/lib/apr/file_io/os2/maperrorcode.c
  
  Index: maperrorcode.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/maperrorcode.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- maperrorcode.c	2000/03/31 08:35:48	1.6
  +++ maperrorcode.c	2000/04/19 16:26:33	1.7
  @@ -75,6 +75,8 @@
       { ERROR_INVALID_FUNCTION,     APR_EINVAL       },
       { ERROR_INVALID_HANDLE,       APR_EBADF        },
       { ERROR_NEGATIVE_SEEK,        APR_ESPIPE       },
  +    { ERROR_NO_SIGNAL_SENT,       ESRCH            },
  +    { ERROR_NO_DATA,              APR_EAGAIN       },
       { SOCEWOULDBLOCK,           EWOULDBLOCK     },
       { SOCEINPROGRESS,           EINPROGRESS     },
       { SOCEALREADY,              EALREADY        },
  @@ -112,14 +114,21 @@
   
   #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0]))
   
  -int os2errno( ULONG oserror )
  +int ap_canonical_error(ap_status_t err)
   {
       int rv = -1, index;
  -    
  -    for (index=0; index<MAPSIZE && errormap[index][0] != oserror; index++);
  +
  +    if (err < APR_OS_START_SYSERR)
  +        return err;
  +
  +    err -= APR_OS_START_SYSERR;
  +
  +    for (index=0; index<MAPSIZE && errormap[index][0] != err; index++);
       
       if (index<MAPSIZE)
           rv = errormap[index][1];
  +    else
  +        fprintf(stderr, "ap_canonical_error: Unknown OS/2 error code %d\n", err );
           
       return rv;
   }