X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=bc64031490140d5ab36562ba5eaf9c53d645f53d;hb=43c72093ade72f14cb2fc78bef55dade8cd38df7;hp=e022cdd5ece4c4fa1fc232b39cc4e76496aa12f6;hpb=8e732fcbbb5ac627ea302bf5c0ea17ec9b3cea7c;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index e022cdd5..bc640314 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1437,19 +1437,8 @@ static int cmd_config(int argc, char *argv[]) { FILE *f = fopen(filename, "r"); if(!f) { - if(action < 0 || errno != ENOENT) { - fprintf(stderr, "Could not open configuration file %s: %s\n", filename, strerror(errno)); - return 1; - } - - // If it doesn't exist, create it. - f = fopen(filename, "a+"); - if(!f) { - fprintf(stderr, "Could not create configuration file %s: %s\n", filename, strerror(errno)); - return 1; - } else { - fprintf(stderr, "Created configuration file %s.\n", filename); - } + fprintf(stderr, "Could not open configuration file %s: %s\n", filename, strerror(errno)); + return 1; } char *tmpfile = NULL;