apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/file_io/unix flock.c
Date Tue, 28 Aug 2001 16:48:25 GMT
trawick     01/08/28 09:48:25

  Modified:    file_io/unix flock.c
  Log:
  on some Unix boxes (e.g., Tru64), a non-blocking fcntl() lock request
  returns EACCES instead of the usual EAGAIN when some other task holds
  the lock
  
  since APR_STATUS_IS_EAGAIN() in the caller can't reasonably check for
  EACCES (since that would break other things), map EACCES to EAGAIN in
  the error path from fcntl()
  
  Revision  Changes    Path
  1.6       +9 -1      apr/file_io/unix/flock.c
  
  Index: flock.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/flock.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- flock.c	2001/08/10 21:04:47	1.5
  +++ flock.c	2001/08/28 16:48:25	1.6
  @@ -84,8 +84,16 @@
           while ((rc = fcntl(thefile->filedes, fc, &l)) < 0 && errno ==
EINTR)
               continue;
   
  -        if (rc == -1)
  +        if (rc == -1) {
  +            /* on some Unix boxes (e.g., Tru64), we get EACCES instead
  +             * of EAGAIN; we don't want APR_STATUS_IS_EAGAIN() matching EACCES
  +             * since that breaks other things, so fix up the retcode here
  +             */
  +            if (errno == EACCES) {
  +                return EAGAIN;
  +            }
               return errno;
  +        }
       }
   #elif defined(HAVE_SYS_FILE_H)
       {
  
  
  

Mime
View raw message