manoj       99/10/22 15:08:18

  Modified:    src/include buff.h
               src/main buff.c
  Log:
  Change ap_bgetopt and ap_bsetopt to use APR-style return codes instead
  of errno. There's no effect on other Apache code since nothing actually
  checks return values on these functions.
  
  Revision  Changes    Path
  1.4       +2 -2      apache-2.0/src/include/buff.h
  
  Index: buff.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/buff.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -u -r1.3 -r1.4
  --- buff.h    1999/08/31 05:32:17     1.3
  +++ buff.h    1999/10/22 22:08:11     1.4
  @@ -169,8 +169,8 @@
   /* XXX - unused right now - mvsk */
   API_EXPORT(BUFF *) ap_bopenf(ap_context_t *a, const char *name, int flg, int 
mode);
   
  -API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval);
  -API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval);
  +API_EXPORT(ap_status_t) ap_bsetopt(BUFF *fb, int optname, const void 
*optval);
  +API_EXPORT(ap_status_t) ap_bgetopt(BUFF *fb, int optname, void *optval);
   API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value);
   API_EXPORT(int) ap_bclose(BUFF *fb);
   
  
  
  
  1.10      +6 -21     apache-2.0/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/buff.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -d -u -r1.9 -r1.10
  --- buff.c    1999/10/21 19:00:18     1.9
  +++ buff.c    1999/10/22 22:08:15     1.10
  @@ -201,8 +201,6 @@
   
   API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval)
   {
  -    int rv;
  -
       switch (optname) {
       case BO_BYTECT:
        fb->bytes_sent = *(const long int *) optval - (long int) fb->outcnt;
  @@ -214,21 +212,14 @@
            fb->flags |= B_NONBLOCK;
            /* XXX: should remove B_WR now... */
        }
  -     rv = iol_setopt(fb->iol, AP_IOL_TIMEOUT, optval);
  -        if (rv == APR_SUCCESS) {
  -            return 0;
  -        }
  -        errno = rv;
  -        return -1;
  +     return iol_setopt(fb->iol, AP_IOL_TIMEOUT, optval);
       }
  -    errno = EINVAL;
  -    return -1;
  +    return APR_EINVAL;
   }
   
  -API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval)
  +API_EXPORT(ap_status_t) ap_bgetopt(BUFF *fb, int optname, void *optval)
   {
       long int bs;
  -    int rv;
   
       switch (optname) {
       case BO_BYTECT:
  @@ -236,18 +227,12 @@
        if (bs < 0L)
            bs = 0L;
        *(long int *) optval = bs;
  -     return 0;
  +     return APR_SUCCESS;
   
       case BO_TIMEOUT:
  -     rv = iol_getopt(fb->iol, AP_IOL_TIMEOUT, optval);
  -        if (rv == APR_SUCCESS) {
  -            return 0;
  -        }
  -        errno = rv;
  -        return -1;
  +     return iol_getopt(fb->iol, AP_IOL_TIMEOUT, optval);
       }
  -    errno = EINVAL;
  -    return -1;
  +    return APR_EINVAL;
   }
   
   static void start_chunk(BUFF *fb)
  
  
  

Reply via email to