manoj       99/04/22 12:09:02

  Modified:    pthreads/src/main acceptlock.c
  Log:
  Go back to old behavior of retrying flock and fcntl when EINTR is
  received. Our worker and acceptor threads don't receive signals anyway,
  and the old code would make us retry fcntl if we got any error besides
  EINTR.
  
  Revision  Changes    Path
  1.8       +7 -7      apache-apr/pthreads/src/main/acceptlock.c
  
  Index: acceptlock.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/acceptlock.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -u -r1.7 -r1.8
  --- acceptlock.c      1999/04/17 03:35:54     1.7
  +++ acceptlock.c      1999/04/22 19:09:01     1.8
  @@ -530,11 +530,11 @@
   
       intra_mutex_on(locknum);
       while ((ret = fcntl(lock_fd[locknum], F_SETLKW, &lock_it)) < 0 && 
  -        errno != EINTR) {
  +        errno == EINTR) {
        /* nop */
       }
   
  -    if (ret < 0 && errno != EINTR) {
  +    if (ret < 0) {
        ap_log_error(APLOG_MARK, APLOG_EMERG, (const server_rec*) 
ap_get_server_conf(),
                    "fcntl: F_SETLKW: Error getting accept lock, exiting!  "
                    "Perhaps you need to use the LockFile directive to place "
  @@ -548,10 +548,10 @@
       int ret;
   
       while ((ret = fcntl(lock_fd[locknum], F_SETLKW, &unlock_it)) < 0 
  -        && errno != EINTR) {
  +        && errno == EINTR) {
        /* nop */
       }
  -    if (ret < 0 && errno != EINTR) {
  +    if (ret < 0) {
        ap_log_error(APLOG_MARK, APLOG_EMERG, (const server_rec*) 
ap_get_server_conf(),
                    "fcntl: F_SETLKW: Error freeing accept lock, exiting!  "
                    "Perhaps you need to use the LockFile directive to place "
  @@ -630,10 +630,10 @@
       int ret;
   
       intra_mutex_on(locknum);
  -    while ((ret = flock(lock_fd[locknum], LOCK_EX)) < 0 && errno != EINTR)
  +    while ((ret = flock(lock_fd[locknum], LOCK_EX)) < 0 && errno == EINTR)
           continue;
   
  -    if (ret < 0 && errno != EINTR) {
  +    if (ret < 0) {
           ap_log_error(APLOG_MARK, APLOG_EMERG, 
                     (const server_rec *) ap_get_server_conf(),
                     "flock: LOCK_EX: Error getting accept lock. Exiting!");
  @@ -643,7 +643,7 @@
   
   void accept_mutex_off(int locknum)
   {
  -    if (flock(lock_fd[locknum], LOCK_UN) < 0 && errno != EINTR) {
  +    if (flock(lock_fd[locknum], LOCK_UN) < 0) {
           ap_log_error(APLOG_MARK, APLOG_EMERG, 
                     (const server_rec *) ap_get_server_conf(),
                     "flock: LOCK_UN: Error freeing accept lock. Exiting!");
  
  
  

Reply via email to