Fix file paths within CLIENT_DATA_DIR
This commit is contained in:
parent
a927c5c36c
commit
87b3f984c1
2 changed files with 3 additions and 3 deletions
|
@ -136,7 +136,7 @@ void write_log(int type, const char *fmt, ...)
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
char *client_log = memalloc(PATH_MAX);
|
char *client_log = memalloc(PATH_MAX);
|
||||||
snprintf(client_log, PATH_MAX, "%s/%s", CLIENT_DATA_DIR, "zen.log");
|
snprintf(client_log, PATH_MAX, "%s/%s", CLIENT_DATA_DIR, "/zen.log");
|
||||||
if (access(client_log, W_OK) != 0) {
|
if (access(client_log, W_OK) != 0) {
|
||||||
/* If log file doesn't exist, most likely data dir won't exist too */
|
/* If log file doesn't exist, most likely data dir won't exist too */
|
||||||
create_data_dir();
|
create_data_dir();
|
||||||
|
@ -155,8 +155,8 @@ void write_log(int type, const char *fmt, ...)
|
||||||
snprintf(details, 2 + type_len + 22, "%s%s", logtype, time);
|
snprintf(details, 2 + type_len + 22, "%s%s", logtype, time);
|
||||||
fprintf(log, details);
|
fprintf(log, details);
|
||||||
vfprintf(log, fmt, args);
|
vfprintf(log, fmt, args);
|
||||||
}
|
|
||||||
fclose(log);
|
fclose(log);
|
||||||
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ int sqlite_init()
|
||||||
char *err_msg = 0;
|
char *err_msg = 0;
|
||||||
|
|
||||||
char *zen_db = memalloc(PATH_MAX);
|
char *zen_db = memalloc(PATH_MAX);
|
||||||
snprintf(zen_db, PATH_MAX, "%s/%s", CLIENT_DATA_DIR, "zen.db");
|
snprintf(zen_db, PATH_MAX, "%s/%s", CLIENT_DATA_DIR, "/zen.db");
|
||||||
if (access(zen_db, W_OK) != 0) {
|
if (access(zen_db, W_OK) != 0) {
|
||||||
/* If log file doesn't exist, most likely data dir won't exist too */
|
/* If log file doesn't exist, most likely data dir won't exist too */
|
||||||
create_data_dir();
|
create_data_dir();
|
||||||
|
|
Loading…
Reference in a new issue