]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Support starting containers concurrently
authorS.Çağlar Onur <caglar@10ur.org>
Tue, 23 Apr 2013 21:24:31 +0000 (17:24 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 24 Apr 2013 23:30:42 +0000 (01:30 +0200)
Trying to start multiple containers concurrently may cause
lxc_monitor_read_timeout to fail as select call could be
interrupted by a signal, handle it.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/state.c

index 313cbb9ce98a31ff472e1518d08d6898e73a0539..4ab131a4cae52b94be72bbda99b2324e1b9989ad 100644 (file)
@@ -236,8 +236,11 @@ extern int lxc_wait(const char *lxcname, const char *states, int timeout, const
                                goto out_close;
                        curtime = tv.tv_sec;
                }
-               if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0)
-                       goto out_close;
+               if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0) {
+                       /* try again if select interrupted by signal */
+                       if (errno != EINTR)
+                               goto out_close;
+               }
 
                if (timeout != -1) {
                        retval = gettimeofday(&tv, NULL);