This commit is contained in:
Andrew Pamment 2018-05-24 14:13:02 +10:00
parent 1fd7dc5230
commit 0f0ba2c368
2 changed files with 5 additions and 0 deletions

View File

@ -229,6 +229,8 @@ void remove_config_file_area(int areaid) {
}
fgets(buffer, 256, fptr1);
}
fclose(fptr1);
fclose(fptr2);
unlink(config_file);
rename(backup, config_file);
}
@ -255,6 +257,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "OUTDIR must be defined\n");
return -1;
}
config_file = argv[1];
if (strcasecmp(argv[2], "ADD") == 0) {
// send add control message

View File

@ -299,6 +299,8 @@ void update_config_file_area(int areaid) {
}
fgets(buffer, 256, fptr1);
}
fclose(fptr1);
fclose(fptr2);
unlink(config_file);
rename(backup, config_file);
}