You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
633 B

  1. On OpenWrt targets the tmp filesystem is wiped upon power cycle, so files
  2. requires to be created.
  3. --- a/service/SettingsConfuse.cpp
  4. +++ b/service/SettingsConfuse.cpp
  5. @@ -436,6 +436,13 @@ bool readVarConfig(cfg_t **cfg) {
  6. FILE *fp = fopen(VAR_CONFIG_FILE, "re"); // e for setting O_CLOEXEC on the file handle
  7. if (!fp) {
  8. (*cfg) = 0;
  9. + fp = fopen(VAR_CONFIG_FILE, "we"); // If missing, create file if possible
  10. + if(fp) {
  11. + fclose(fp);
  12. + }
  13. + else {
  14. + Log::warning("Unable to create var config file, %s", VAR_CONFIG_FILE);
  15. + }
  16. Log::warning("Unable to open var config file, %s", VAR_CONFIG_FILE);
  17. return false;
  18. }