diff options
author | Michael Stapelberg <michael+x200@stapelberg.de> | 2008-10-29 23:26:26 +0100 |
---|---|---|
committer | Michael Stapelberg <michael+x200@stapelberg.de> | 2008-10-29 23:26:26 +0100 |
commit | 7d0f324b7a8e009da9fe5d61a60dc1c08526b46d (patch) | |
tree | d62181274447c28844c628e17b7e656493c90991 /config.c | |
parent | 554a984fe6b8f29059cfa304778a465dce46c9d3 (diff) |
Make wmiistatus run all the time and wait for wmii_path to exist
Instead of exiting as a file inside wmii_path cannot be opened, we wait
until wmii_path is found again (particularly the /rbar part, that is),
re-setup our files and continue as if nothing happened.
This will make wmiistatus survive restarts of wmii and make it wait for
/mnt/wmii to appear when booting up (and wmiistatus gets started before
wmii itself)
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -109,8 +109,12 @@ int load_configuration(const char *configfile) { OPT("wmii_path") { char *globbed = glob_path(dest_value); - if ((stat(globbed, &stbuf)) == -1) - die("wmii_path contains an invalid path"); + if ((stat(globbed, &stbuf)) == -1) { + fprintf(stderr, "Warning: wmii_path contains an invalid path\n"); + free(globbed); + globbed = strdup(dest_value); + } + fprintf(stderr, "gots path: %s\n", globbed); if (globbed[strlen(globbed)-1] != '/') die("wmii_path is not terminated by /"); wmii_path = globbed; @@ -184,7 +188,7 @@ int load_configuration(const char *configfile) { fclose(handle); if (wmii_path == NULL) - exit(-4); + exit(EXIT_FAILURE); return result; } |