diff options
-rw-r--r-- | src/main.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc index 00fa51f..26070dc 100644 --- a/src/main.cc +++ b/src/main.cc | |||
@@ -52,6 +52,10 @@ | |||
52 | #include <string.h> | 52 | #include <string.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifdef HAVE_UNISTD_H | ||
56 | #include <unistd.h> | ||
57 | #endif | ||
58 | |||
55 | #ifdef HAVE_SYS_STAT_H | 59 | #ifdef HAVE_SYS_STAT_H |
56 | #include <sys/types.h> | 60 | #include <sys/types.h> |
57 | #include <sys/stat.h> | 61 | #include <sys/stat.h> |
@@ -365,13 +369,19 @@ void setupConfigFiles(const std::string& dirname, const std::string& rc) { | |||
365 | } | 369 | } |
366 | } | 370 | } |
367 | 371 | ||
372 | bool sync_fs = false; | ||
373 | |||
368 | // copy default files if needed | 374 | // copy default files if needed |
369 | for (size_t i = 0; i < nr_of_cfiles; ++i) { | 375 | for (size_t i = 0; i < nr_of_cfiles; ++i) { |
370 | if (cfiles[i].create_file) { | 376 | if (cfiles[i].create_file) { |
371 | FbTk::FileUtil::copyFile(cfiles[i].default_name, cfiles[i].filename.c_str()); | 377 | FbTk::FileUtil::copyFile(cfiles[i].default_name, cfiles[i].filename.c_str()); |
378 | sync_fs = true; | ||
372 | } | 379 | } |
373 | } | 380 | } |
374 | 381 | ||
382 | if (sync_fs) { | ||
383 | sync(); | ||
384 | } | ||
375 | } | 385 | } |
376 | 386 | ||
377 | 387 | ||
@@ -408,6 +418,7 @@ void updateConfigFilesIfNeeded(const std::string& rc_file) { | |||
408 | << commandargs | 418 | << commandargs |
409 | << "' failed." << endl; | 419 | << "' failed." << endl; |
410 | } | 420 | } |
421 | sync(); | ||
411 | } | 422 | } |
412 | } | 423 | } |
413 | 424 | ||