File was renamed from project/socketd/client.c |
| | |
| | | int daemon = 1; |
| | | int opt; |
| | | char *progname=NULL; |
| | | char *logfile="client.log"; |
| | | int loglevel=LOG_LEVEL_INFO; |
| | | int logsize=10; /* logfile size max to 10K */ |
| | | char *logfile="client.log"; |
| | | int loglevel=LOG_LEVEL_INFO; |
| | | int logsize=10; /* logfile size max to 10K */ |
| | | |
| | | struct option long_options[] = { |
| | | {"debug", no_argument, NULL, 'd'}, |
| | |
| | | { |
| | | case 'd': /* Set debug running */ |
| | | daemon = 0; |
| | | logfile="console"; |
| | | loglevel=LOG_LEVEL_DEBUG; |
| | | logfile="console"; |
| | | loglevel=LOG_LEVEL_DEBUG; |
| | | break; |
| | | |
| | | case 'v': /* Get software version */ |
| | |
| | | |
| | | } |
| | | |
| | | if( log_open(logfile, loglevel, logsize, THREAD_LOCK_NONE) < 0 ) |
| | | { |
| | | fprintf(stderr, "Initial log system failed\n"); |
| | | return 1; |
| | | } |
| | | if( log_open(logfile, loglevel, logsize, THREAD_LOCK_NONE) < 0 ) |
| | | { |
| | | fprintf(stderr, "Initial log system failed\n"); |
| | | return 1; |
| | | } |
| | | |
| | | install_default_signal(); |
| | | |
| | |
| | | |
| | | cleanup: |
| | | log_close(); |
| | | unlink(DAEMON_PIDFILE); |
| | | |
| | | return 0; |
| | | } |