Changeset 538 for trunk/src/ocatsetup.c


Ignore:
Timestamp:
01/24/10 19:55:24 (2 years ago)
Author:
eagle
Message:
  • options are parsed sequentially (-f and -I first)
  • config file is always read from SYSCONFDIR (usually /etc or /usr/local/etc)
  • changed Makefile.am to not install header files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ocatsetup.c

    r536 r538  
    5757   //ADDR4_PREFIX, ADDR4_MASK 
    5858   {0}, 0, 
    59    NULL, 1, 
     59   // config_file, config_read, config_failed 
     60   NULL, 0, 0, 
    6061#ifdef __CYGWIN__ 
    6162   1, 
     
    148149void post_init_setup(void) 
    149150{ 
     151   size_t l; 
    150152   setup_.ocat_addr4 = NDESC(prefix4); 
    151153   setup_.ocat_addr4_mask = NDESC(addr4_mask); 
    152154   setup_.ocat_dest_port = NDESC(vdest_port); 
    153155   setup_.ocat_ctrl_port = NDESC(ctrl_port); 
     156 
     157   l = strlen(SYSCONFDIR) + strlen(NDESC(config_file)) + 2; 
     158   if ((setup_.config_file = malloc(l)) != NULL) 
     159      snprintf(setup_.config_file, l, "%s/%s", SYSCONFDIR, NDESC(config_file)); 
     160   else 
     161      log_msg(LOG_WARNING, "could not get memory for config file string: \"%s\"", strerror(errno)); 
    154162 
    155163   if (!setup_.socks_dst->sin_port) 
Note: See TracChangeset for help on using the changeset viewer.