提交 75d9e23f 编写于 作者: G gaohuatao 提交者: lifeng68

devmapper: modify metafile write method

Signed-off-by: Ngaohuatao <gaohuatao@huawei.com>
上级 32c9572a
......@@ -1140,7 +1140,7 @@ static int save_metadata(struct device_set *devset, image_devmapper_device_info
goto out;
}
if (util_write_file(fname, metadata_json, strlen(metadata_json), DEFAULT_SECURE_FILE_MODE) != 0) {
if (util_atomic_write_file(fname, metadata_json, strlen(metadata_json), DEFAULT_SECURE_FILE_MODE) != 0) {
ret = -1;
ERROR("failed write process.json");
goto out;
......@@ -1177,7 +1177,7 @@ static int save_transaction_metadata(struct device_set *devset)
goto out;
}
if (util_write_file(fname, trans_json, strlen(trans_json), DEFAULT_SECURE_FILE_MODE) != 0) {
if (util_atomic_write_file(fname, trans_json, strlen(trans_json), DEFAULT_SECURE_FILE_MODE) != 0) {
ret = -1;
ERROR("failed write process.json");
goto out;
......@@ -1222,7 +1222,7 @@ static int save_deviceset_matadata(struct device_set *devset)
goto free_out;
}
if (util_write_file(fname, metadata_json, strlen(metadata_json), DEFAULT_SECURE_FILE_MODE) != 0) {
if (util_atomic_write_file(fname, metadata_json, strlen(metadata_json), DEFAULT_SECURE_FILE_MODE) != 0) {
ret = -1;
ERROR("failed write process.json");
goto free_out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册