[lxc-devel] [PATCH] add process_lock()/unlock() in save_config()

Dwight Engen dwight.engen at oracle.com
Tue Nov 12 19:04:39 UTC 2013


This is likely unnecessary, but is consistent with other uses of
fopen()/fclose() in lxc.

Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
 src/lxc/lxccontainer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index ede0113..c7b2f5e 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1696,11 +1696,15 @@ static bool lxcapi_save_config(struct lxc_container *c, const char *alt_file)
 	if (lret)
 		return false;
 
+	process_lock();
 	fout = fopen(alt_file, "w");
+	process_unlock();
 	if (!fout)
 		goto out;
 	write_config(fout, c->lxc_conf);
+	process_lock();
 	fclose(fout);
+	process_unlock();
 	ret = true;
 
 out:
-- 
1.8.3.1





More information about the lxc-devel mailing list