You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Robert S. Thau" <rs...@ai.mit.edu> on 1995/08/16 16:02:55 UTC

Better Solaris fix...

Well, it turns out that locking the scoreboard file (as per previous
patch) doesn't work directly, because tmpfs doesn't support locking of
*any* sort.  It does appear to work (I'm running with it on port 80)
with the scoreboard file in /usr/tmp, which is generally not a tmpfs;
revised patch below.

Sun Quality Software... gotta love it.  Waaaaaahhh....

*** http_main.c~	Sat Aug 12 10:45:01 1995
--- http_main.c	Wed Aug 16 09:58:55 1995
***************
*** 140,151 ****
  #ifdef FCNTL_SERIALIZED_ACCEPT
  struct flock lock_it = { F_WRLCK, 0, 0, 0 };
  struct flock unlock_it = { F_UNLCK, 0, 0, 0 };
  
  void accept_mutex_on()
  {
      int ret;
      
!     while ((ret = fcntl(fileno(server_conf->error_log),F_SETLKW, &lock_it)) < 0
  	   && errno == EINTR)
  	continue;
  
--- 140,152 ----
  #ifdef FCNTL_SERIALIZED_ACCEPT
  struct flock lock_it = { F_WRLCK, 0, 0, 0 };
  struct flock unlock_it = { F_UNLCK, 0, 0, 0 };
+ static int scoreboard_fd;
  
  void accept_mutex_on()
  {
      int ret;
      
!     while ((ret = fcntl(scoreboard_fd, F_SETLKW, &lock_it)) < 0
  	   && errno == EINTR)
  	continue;
  
***************
*** 158,164 ****
  
  void accept_mutex_off()
  {
!     fcntl (fileno(server_conf->error_log), F_SETLKW, &unlock_it);
  }
  #else
  /* Default --- no serialization.  Other methods *could* go here,
--- 159,165 ----
  
  void accept_mutex_off()
  {
!     fcntl (scoreboard_fd, F_SETLKW, &unlock_it);
  }
  #else
  /* Default --- no serialization.  Other methods *could* go here,
***************
*** 288,294 ****
   */
  
  static short_score scoreboard_image[HARD_SERVER_MAX];
! static char scoreboard_fname[] = "/tmp/htstatus.XXXXXX";
  static int have_scoreboard_fname = 0;
  static int scoreboard_fd;
  
--- 289,295 ----
   */
  
  static short_score scoreboard_image[HARD_SERVER_MAX];
! static char scoreboard_fname[] = "/usr/tmp/htstatus.XXXXXX";
  static int have_scoreboard_fname = 0;
  static int scoreboard_fd;