X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=3bc17e233fd34f69c77dc094f1c91499a0ccd938;hp=b62c8c1903a7cf30002b2a1a0ba57efd1f9ce2fa;hb=af9ee7ff003fb448b783ccf39347907adc239cb2;hpb=11868b890d1a7f4cfbfb37099393b32019010f66 diff --git a/src/tincd.c b/src/tincd.c index b62c8c19..3bc17e23 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -43,8 +43,6 @@ #include #endif -#include - #include "conf.h" #include "control.h" #include "crypto.h" @@ -340,11 +338,12 @@ int main(int argc, char **argv) { return 1; make_names(true); + chdir(confbase); if(show_version) { printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE, BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR); - printf("Copyright (C) 1998-2014 Ivo Timmermans, Guus Sliepen and others.\n" + printf("Copyright (C) 1998-2015 Ivo Timmermans, Guus Sliepen and others.\n" "See the AUTHORS file for a complete list.\n\n" "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" "and you are welcome to redistribute it under certain conditions;\n" @@ -370,6 +369,10 @@ int main(int argc, char **argv) { umbilical = atoi(umbstr); if(fcntl(umbilical, F_GETFL) < 0) umbilical = 0; +#ifdef FD_CLOEXEC + if(umbilical) + fcntl(umbilical, F_SETFD, FD_CLOEXEC); +#endif } #endif