~serge-hallyn/ubuntu/quantal/lxc/lxc-fixapi

« back to all changes in this revision

Viewing changes to src/lxc/lxccontainer.c

  • Committer: Serge Hallyn
  • Date: 2012-08-24 02:02:26 UTC
  • Revision ID: serge.hallyn@ubuntu.com-20120824020226-hotaieauojintzww
fix lxcapi_start to not return true when it container failed to start.

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
                "/sbin/init",
258
258
                '\0',
259
259
        };
260
 
        bool needreboot;
261
260
 
262
261
        /* container exists */
263
262
        if (!c)
324
323
reboot:
325
324
        ret = lxc_start(c->name, argv, conf);
326
325
 
327
 
        needreboot = false;
328
 
        if (lxclock(c->privlock, 0))
329
 
                return true;
330
 
        conf = c->lxc_conf;
331
 
        if (conf && conf->reboot) {
 
326
        if (conf->reboot) {
332
327
                INFO("container requested reboot");
333
328
                conf->reboot = 0;
334
329
                if (conf->maincmd_fd)
335
330
                        close(conf->maincmd_fd);
336
331
                conf->maincmd_fd = 0;
337
 
                needreboot = true;
338
 
        }
339
 
        lxcunlock(c->privlock);
340
 
        if (needreboot)
341
332
                goto reboot;
 
333
        }
342
334
 
343
335
        if (daemonize) {
344
336
                lxc_container_put(c);