You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2001/08/28 18:48:25 UTC

cvs commit: apr/file_io/unix flock.c

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)
       {