httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/locks/unix crossproc.c locks.c
Date Sat, 03 Jun 2000 03:24:39 GMT
trawick     00/06/02 20:24:39

  Modified:    src/lib/apr/locks/unix crossproc.c locks.c
  Log:
  fix problems in recent change to use mkstemp(); also, fix
  not-so-recent bug in flock support (destroy_inter_lock was
  renamed to ap_unix_destroy_inter_lock)
  
  Revision  Changes    Path
  1.28      +15 -3     apache-2.0/src/lib/apr/locks/unix/crossproc.c
  
  Index: crossproc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- crossproc.c	2000/04/14 15:58:30	1.27
  +++ crossproc.c	2000/06/03 03:24:38	1.28
  @@ -269,7 +269,13 @@
   
   ap_status_t ap_unix_create_inter_lock(ap_lock_t *new)
   {
  -    new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
  +    if (new->fname) {
  +        new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
  +    }
  +    else {
  +        new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); 
  +        new->interproc = mkstemp(new->fname);
  +    }
   
       if (new->interproc < 0) {
           lock_cleanup(new);
  @@ -338,7 +344,13 @@
   
   ap_status_t ap_unix_create_inter_lock(ap_lock_t *new)
   {
  -    new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
  +    if (new->fname) {
  +        new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
  +    }
  +    else {
  +        new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); 
  +        new->interproc = mkstemp(new->fname);
  +    }
   
       if (new->interproc < 0) {
           lock_cleanup(new);
  @@ -387,7 +399,7 @@
       new->fname = ap_pstrdup(cont, fname);
       new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
       if (new->interproc == -1) {
  -        destroy_inter_lock(new);
  +        ap_unix_destroy_inter_lock(new);
           return errno;
       }
       return APR_SUCCESS;
  
  
  
  1.33      +0 -6      apache-2.0/src/lib/apr/locks/unix/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- locks.c	2000/06/03 00:31:13	1.32
  +++ locks.c	2000/06/03 03:24:38	1.33
  @@ -73,12 +73,6 @@
           if (fname != NULL) {
               new->fname = ap_pstrdup(cont, fname);
           }
  -        else {
  -            char *filename = "/tmp/aprXXXXXX";
  -            new->interproc = mkstemp(filename);
  -            new->fname = ap_pstrdup(cont, filename); 
  -            unlink(new->fname);
  -	}
       }
   #endif
   
  
  
  

Mime
View raw message