]> git.proxmox.com Git - mirror_lxc.git/commitdiff
add process_lock()/unlock() in save_config()
authorDwight Engen <dwight.engen@oracle.com>
Tue, 12 Nov 2013 19:04:39 +0000 (14:04 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 12 Nov 2013 20:43:43 +0000 (14:43 -0600)
This is likely unnecessary, but is consistent with other uses of
fopen()/fclose() in lxc.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 0a94f5e6b9e9eed21b421d27ed11ca2e0a4840f9..05ca643ec4d715b1dafa8faaabe380d7acec79f8 100644 (file)
@@ -1700,11 +1700,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: