X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincctl.c;h=00757c47a57b96d7c3f258acd92652be66e9cac1;hp=bbc5c026022c7f7f4bfb0a3f7e23238bf92949de;hb=706d855e507980de3845556989d7de7a3b9c76e8;hpb=87e09527735632aae3f595f5a28667880ca4c8c1 diff --git a/src/tincctl.c b/src/tincctl.c index bbc5c026..00757c47 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -89,7 +89,7 @@ static struct option const long_options[] = { static void version(void) { 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" @@ -233,6 +233,12 @@ FILE *fopenmask(const char *filename, const char *mode, mode_t perms) { perms &= ~mask; umask(~perms); FILE *f = fopen(filename, mode); + + if(!f) { + fprintf(stderr, "Could not open %s: %s\n", filename, strerror(errno)); + return NULL; + } + #ifdef HAVE_FCHMOD if((perms & 0444) && f) fchmod(fileno(f), perms);