diff options
author | Andy Grover <andy@groveronline.com> | 2016-01-19 08:15:18 -0800 |
---|---|---|
committer | Andy Grover <andy@groveronline.com> | 2016-01-19 08:15:18 -0800 |
commit | 2b1278524510a1568769e27bded52246c5b5d84c (patch) | |
tree | e050011d57a1aee194706cbc6e55ad0c3dea2355 | |
parent | 903b61005f067e9d8c6f6e9d629d9caf0c29ac16 (diff) | |
parent | b625f61a03d2127239480b45fed80028f82f8a50 (diff) | |
download | rtslib-fb-2b1278524510a1568769e27bded52246c5b5d84c.tar.gz |
Merge pull request #70 from jmagrini/origin
Ensure internal buffers are flushed when saveconfig.json …
-rw-r--r-- | rtslib/root.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rtslib/root.py b/rtslib/root.py index a4fbb2e..083a2c2 100644 --- a/rtslib/root.py +++ b/rtslib/root.py @@ -249,7 +249,9 @@ class RTSRoot(CFSNode): os.fchmod(f.fileno(), stat.S_IRUSR | stat.S_IWUSR) f.write(json.dumps(self.dump(), sort_keys=True, indent=2)) f.write("\n") + f.flush() os.fsync(f.fileno()) + f.close() os.rename(save_file+".temp", save_file) |