summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-02-10 20:41:55 +0100
committerGitHub <noreply@github.com>2023-02-10 20:41:55 +0100
commit6333455c29dd191d8220794b74e8dfe9fa382604 (patch)
tree83b689f2be0b14df7eda5084410f3a59c6109290
parent0f42786a0b3d151cd4c783a8581ad8bb3d1f9b05 (diff)
parentcc8f94b3791135ad764de03e518a1c46f050f456 (diff)
downloadvyatta-cfg-6333455c29dd191d8220794b74e8dfe9fa382604.tar.gz
vyatta-cfg-6333455c29dd191d8220794b74e8dfe9fa382604.zip
Merge pull request #59 from dmbaturin/T4990-post-commit-sync
commit: T4990: call sync after the commit completes
-rw-r--r--src/commit/commit-algorithm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commit/commit-algorithm.cpp b/src/commit/commit-algorithm.cpp
index 13d3500..f04b8c2 100644
--- a/src/commit/commit-algorithm.cpp
+++ b/src/commit/commit-algorithm.cpp
@@ -14,6 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <unistd.h>
+
#include <cstdio>
#include <vector>
#include <string>
@@ -1358,6 +1360,8 @@ commit::doCommit(Cstore& cs, CfgNode& cfg1, CfgNode& cfg2)
ret = cs.markSessionUnsaved();
}
+ sync();
+
setenv("COMMIT_STATUS", cst, 1);
_execute_hooks(POST_COMMIT);
unsetenv("COMMIT_STATUS");