X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Ftincd.c;h=eea15dbddf5d44ffd39e29e91bd2980b63c832ca;hb=5055e1dedc9fe984c497448c1b2ffc4afdf18aa3;hp=a99b81bc8de82b58013adbc2ad3cc737bacf3577;hpb=b4c1d4e2d3287acd7ca438455c64e50a2828ad24;p=tinc diff --git a/src/tincd.c b/src/tincd.c index a99b81bc..eea15dbd 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: tincd.c,v 1.10.4.23 2000/10/30 10:19:06 guus Exp $ + $Id: tincd.c,v 1.10.4.26 2000/11/08 00:20:06 guus Exp $ */ #include "config.h" @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef HAVE_SYS_IOCTL_H # include @@ -74,6 +75,8 @@ char *identname; /* program name for syslog */ char *pidfilename; /* pid file location */ static pid_t ppid; /* pid of non-detached part */ char **g_argv; /* a copy of the cmdline arguments */ +char **environment; /* A pointer to the environment on + startup */ void cleanup_and_exit(int); int detach(void); @@ -85,6 +88,7 @@ int write_pidfile(void); static struct option const long_options[] = { + { "config", required_argument, NULL, 'c' }, { "kill", no_argument, NULL, 'k' }, { "net", required_argument, NULL, 'n' }, { "help", no_argument, &show_help, 1 }, @@ -366,6 +370,8 @@ void make_names(void) asprintf(&pidfilename, "/var/run/tinc.%s.pid", netname); if(!confbase) asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname); + else + fprintf(stderr, "Both netname and configuration directory given, using the latter...\n"); if(!identname) asprintf(&identname, "tinc.%s", netname); } @@ -393,6 +399,7 @@ main(int argc, char **argv, char **envp) unknown = _("unknown"); + environment = envp; parse_options(argc, argv, envp); if(show_version)