Changeset 0b1d2f2e094f32ac6912ecb9d3d2189fe811c7da

Show
Ignore:
Timestamp:
05/04/09 14:05:03 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1241445903 +0000
git-parent:

[e2900c8ac1c9b41eea65098644ea4c550c730f8b]

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

addresses a lot of warnings. gcc still complains about stuff in xpath stuff, doesn't look like our code though, refs #34

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.in

    r9a3bb66 r0b1d2f2  
    309309AC_CHECK_HEADERS(sys/file.h sys/types.h dirent.h sys/param.h fcntl.h errno.h limits.h \ 
    310310                 sys/resource.h pthread.h semaphore.h pwd.h stdio.h stdlib.h string.h \ 
    311                  ctype.h unistd.h time.h sys/stat.h sys/event.h libkern/OSAtomic.h \ 
     311                 ctype.h unistd.h time.h pty.h sys/stat.h sys/event.h libkern/OSAtomic.h \ 
    312312                 term.h termio.h termios.h curses.h sys/cdefs.h grp.h netinet/in_systm.h \ 
    313313                 sys/ioctl_compat.h sys/filio.h util.h sys/time.h sys/mman.h \ 
  • src/modules/external_proc.c

    rb821ef6 r0b1d2f2  
    217217 
    218218  /* switch to / */ 
    219   chdir("/"); 
     219  if(chdir("/") != 0) { 
     220    noitL(noit_error, "Failed chdir(\"/\"): %s\n", strerror(errno)); 
     221    return -1; 
     222  } 
    220223 
    221224  signal(SIGCHLD, external_sigchld); 
  • src/noit_conf.c

    r4c742f5 r0b1d2f2  
    150150    master_config = new_config; 
    151151    xpath_ctxt = xmlXPathNewContext(master_config); 
    152     if(path != master_config_file) realpath(path, master_config_file); 
     152    if(path != master_config_file) 
     153      if(realpath(path, master_config_file) != 0) 
     154        noitL(noit_error, "realpath failed: %s\n", strerror(errno)); 
    153155    noit_conf_mark_changed(); 
    154156    return 0; 
  • src/noit_console.c

    rc207a54 r0b1d2f2  
    66#include "noit_defines.h" 
    77 
     8#include <assert.h> 
    89#include <stdio.h> 
    910#include <unistd.h> 
     
    421422      } 
    422423      else { 
    423         write(ncct->pty_slave, sbuf, len); 
     424        int written; 
     425        written = write(ncct->pty_slave, sbuf, len); 
     426        if(written <= 0) goto socket_error; 
     427        assert(written == len); 
    424428      } 
    425429    } 
  • src/noit_console_state.c

    rc207a54 r0b1d2f2  
    193193  int i, j, count; 
    194194  char *name, *range; 
    195   char **nargv, **expanded
     195  char **nargv, **expanded = NULL
    196196  const char *err; 
    197197  int problems = 0; 
  • src/noit_console_telnet.c

    r3d709f8 r0b1d2f2  
    16721672void 
    16731673ptyflush(noit_console_closure_t ncct) { 
     1674  int written; 
    16741675  if(ncct->telnet->_pty_fill == 0) return; 
    1675   write(ncct->pty_slave, ncct->telnet->_pty_buf, ncct->telnet->_pty_fill); 
     1676  written = write(ncct->pty_slave, ncct->telnet->_pty_buf, 
     1677                  ncct->telnet->_pty_fill); 
     1678  if(written != ncct->telnet->_pty_fill) { 
     1679    /* We can't do anything useful here... just cope. */ 
     1680  } 
    16761681  ncct->telnet->_pty_fill = 0; 
    16771682} 
  • src/noitd.c

    rd074a94 r0b1d2f2  
    11#include "noit_defines.h" 
    22 
     3#include <assert.h> 
    34#include <stdio.h> 
    45#include <stdlib.h> 
     
    4142  printf("Usage for %s:\n", progname); 
    4243#ifdef NOITD_USAGE 
    43   write(STDOUT_FILENO, NOITD_USAGE, sizeof(NOITD_USAGE)-1); 
     44  assert(write(STDOUT_FILENO, 
     45               NOITD_USAGE, 
     46               sizeof(NOITD_USAGE)-1) == sizeof(NOITD_USAGE)-1); 
    4447#else 
    4548  printf("\nError in usage, build problem.\n"); 
     
    276279  setup_mmap(); 
    277280 
    278   chdir("/"); 
     281  if(chdir("/") != 0) { 
     282    noitL(noit_stderr, "Failed chdir(\"/\"): %s\n", strerror(errno)); 
     283    exit(-1); 
     284  } 
    279285  if(foreground) return child_main(); 
    280286 
  • src/stratcon_datastore.c

    ra7ed2df r0b1d2f2  
    653653  nnode->dispatch = f; 
    654654  nnode->next = onlookers; 
    655   while(noit_atomic_casptr((void **)&onlookers, nnode, nnode->next) != nnode->next) 
     655  while(noit_atomic_casptr((void **)&onlookers, nnode, nnode->next) != (vpsized_int)nnode->next) 
    656656    nnode->next = onlookers; 
    657657} 
  • src/stratcond.c

    r6453a67 r0b1d2f2  
    11#include "noit_defines.h" 
    22 
     3#include <assert.h> 
    34#include <stdio.h> 
    45#include <stdlib.h> 
     
    3334  printf("Usage for %s:\n", progname); 
    3435#ifdef STRATCOND_USAGE 
    35   write(STDOUT_FILENO, STRATCOND_USAGE, sizeof(STRATCOND_USAGE)-1); 
     36  assert(write(STDOUT_FILENO, 
     37              STRATCOND_USAGE, 
     38              sizeof(STRATCOND_USAGE)-1) == sizeof(STRATCOND_USAGE)-1); 
    3639#else 
    3740  printf("\nError in usage, build problem.\n"); 
     
    97100  parse_clargs(argc, argv); 
    98101 
    99   chdir("/"); 
     102  if(chdir("/") != 0) { 
     103    fprintf(stderr, "cannot chdir(\"/\"): %s\n", strerror(errno)); 
     104    exit(2); 
     105  } 
    100106  if(!foreground) { 
    101107    close(STDIN_FILENO); 
  • src/utils/noit_atomic.h

    rdf5a719 r0b1d2f2  
    3636 
    3737#if (SIZEOF_VOID_P == 4) 
    38 #define noit_atomic_casptr(a,b,c) noit_atomic_cas32((a),(void *)(b),(void *)(c)) 
     38#define noit_atomic_casptr(a,b,c) noit_atomic_cas32((vpsized_int *)(a),(vpsized_int)(void *)(b),(vpsized_int)(void *)(c)) 
    3939#elif (SIZEOF_VOID_P == 8) 
    40 #define noit_atomic_casptr(a,b,c) noit_atomic_cas64((a),(void *)(b),(void *)(c)) 
     40#define noit_atomic_casptr(a,b,c) noit_atomic_cas64((vpsized_int *)(a),(vpsized_int)(void *)(b),(vpsized_int)(void *)(c)) 
    4141#else 
    4242#error unsupported pointer width