Changeset 4790fc84757a210ff4aed6895cac2729f4a3e497

Show
Ignore:
Timestamp:
10/26/09 13:54:16 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1256565256 +0000
git-parent:

[32caf513db21174aadcdb215e526729da411a265]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1256565256 +0000
Message:

Cleanup and make sure Solaris Sun Studio compilers get -mt and POSIX thread semantics or things will go very wrong, refs #34

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.in

    r2ea7724 r4790fc8  
    5454                AC_MSG_RESULT([32]) 
    5555                ATOMIC_OBJS="noit_atomic_sol_x86_32.o" 
     56        fi 
     57        if test "x$CC" != "xgcc" ; then 
     58                CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -mt" 
    5659        fi 
    5760        PICFLAGS="-Kpic" 
  • src/Makefile.in

    r6523dbe r4790fc8  
    3232NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@ 
    3333 
    34 SUBS=lua utils eventer udns modules noitedit man stomp 
     34SUBS=lua utils eventer udns noitedit man stomp 
     35MODDIR=modules 
    3536 
    3637NOIT_OBJS=noitd.o noit_listener.o \ 
     
    6061        done 
    6162 
     63make-modules: 
     64        @for dir in $(MODDIR) ; do \ 
     65                echo "- building $$dir bits" ; \ 
     66                (cd $$dir && make -s) ; \ 
     67        done 
     68 
    6269java-bits: 
    6370        @echo "- building java bits" 
     
    6774        @(cd jlog && make libjlog.a) 
    6875 
    69 noitd:  make-subdirs $(NOIT_OBJS) 
     76noitd:  make-subdirs make-modules $(NOIT_OBJS) 
    7077        @$(CC) -o $@ $(NOIT_OBJS) \ 
    7178                udns/libudns.o \ 
  • src/noit_capabilities_listener.c

    r6688159 r4790fc8  
    168168  } 
    169169  goto cleanup_shutdown; 
    170  
    171   return 0; 
    172170} 
  • src/noit_conf.h

    r8ad126b r4790fc8  
    130130 
    131131#define EXPOSE_CHECKER(name) \ 
    132   API_EXPORT(pcre *) noit_conf_get_valid_##name##_checker(); 
     132  API_EXPORT(pcre *) noit_conf_get_valid_##name##_checker() 
    133133#define DECLARE_CHECKER(name) \ 
    134134static pcre *checker_valid_##name; \ 
  • src/noit_http.c

    r652d766 r4790fc8  
    5454struct bchain *bchain_alloc(size_t size) { 
    5555  struct bchain *n; 
    56   n = malloc(size + ((void *)n->buff - (void *)n)); 
     56  n = malloc(size + ((char *)n->buff - (char *)n)); 
    5757  if(!n) return NULL; 
    5858  n->prev = n->next = NULL; 
     
    462462    if(rv == noit_true) return mask | EVENTER_WRITE | EVENTER_EXCEPTION; 
    463463  } 
    464   return EVENTER_READ | EVENTER_EXCEPTION; 
     464  /* Not reached: 
     465   * return EVENTER_READ | EVENTER_EXCEPTION; 
     466   */ 
    465467} 
    466468noit_boolean 
     
    522524    while(in && bytes_read < len) { 
    523525      int partial_len = MIN(in->size, len - bytes_read); 
    524       if(buf) memcpy(buf+bytes_read, in->buff+in->start, partial_len); 
     526      if(buf) memcpy((char *)buf+bytes_read, in->buff+in->start, partial_len); 
    525527      bytes_read += partial_len; 
    526528      ctx->req.content_length_read += partial_len; 
     
    636638    ctx->conn.e = NULL; 
    637639    goto release; 
    638     return 0; 
    639640  } 
    640641  if(ctx->res.complete == noit_true) { 
  • src/stratcon_datastore.c

    r30843e7 r4790fc8  
    14291429  nnode->dispatch = f; 
    14301430  nnode->next = onlookers; 
    1431   while(noit_atomic_casptr((void **)&onlookers, nnode, nnode->next) != (void *)nnode->next) 
     1431  while(noit_atomic_casptr((volatile void **)&onlookers, nnode, nnode->next) != (void *)nnode->next) 
    14321432    nnode->next = onlookers; 
    14331433} 
  • src/utils/noit_atomic.h

    re85722c r4790fc8  
    137137extern noit_atomic64_t noit_atomic_cas64(volatile noit_atomic64_t *mem, 
    138138        volatile noit_atomic64_t newval, volatile noit_atomic64_t cmpval); 
     139extern void *noit_atomic_casptr(volatile void **mem, 
     140        volatile void *newval, volatile void *cmpval); 
    139141 
    140142static inline void noit_spinlock_lock(volatile noit_spinlock_t *lock) { 
  • src/utils/noit_watchdog.c

    r5b63423 r4790fc8  
    7474} 
    7575int noit_watchdog_prefork_init() { 
    76   lifeline = mmap(NULL, sizeof(int), PROT_READ|PROT_WRITE, 
    77                   MAP_SHARED|MAP_ANON, -1, 0); 
     76  lifeline = (int *)mmap(NULL, sizeof(int), PROT_READ|PROT_WRITE, 
     77                         MAP_SHARED|MAP_ANON, -1, 0); 
    7878  if(lifeline == (void *)-1) { 
    7979    noitL(noit_error, "Failed to mmap anon for watchdog\n");