]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxclock: return the right error when open lock file failed
authorLong Wang <w@laoqinren.net>
Mon, 3 Jul 2017 07:41:25 +0000 (15:41 +0800)
committerLong Wang <w@laoqinren.net>
Mon, 3 Jul 2017 07:41:25 +0000 (15:41 +0800)
Signed-off-by: Long Wang <w@laoqinren.net>
src/lxc/lxclock.c

index a29568dca1d4c1303936277310bbf91f5b1a0b72..dd23530b077a31e651ea571248f3f7bd9747277e 100644 (file)
@@ -224,6 +224,7 @@ int lxclock(struct lxc_lock *l, int timeout)
                                        S_IWUSR | S_IRUSR);
                        if (l->u.f.fd == -1) {
                                ERROR("Error opening %s", l->u.f.fname);
+                               saved_errno = errno;
                                goto out;
                        }
                }