~ubuntu-branches/ubuntu/quantal/lxc/quantal-201205292108

« back to all changes in this revision

Viewing changes to src/lxc/stop.c

  • Committer: Bazaar Package Importer
  • Author(s): Guido Trotter
  • Date: 2009-07-25 12:24:30 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090725122430-dxv1wb7ds07fc0sk
Tags: 0.6.3-1
* New Upstream Version
* Remove duplicate build-dependency on autotools-dev
* Build depend on linux-libc-dev
* Disable checking of netlink headers from configure
  (currently fails under sid)
* Upgrade standards-version to 3.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
{
43
43
        char init[MAXPATHLEN];
44
44
        char val[MAXPIDLEN];
45
 
        int fd, lock, ret = -LXC_ERROR_INTERNAL;
 
45
        int fd, ret = -1;
46
46
        size_t pid;
47
47
 
48
 
        lock = lxc_get_lock(name);
49
 
        if (lock >= 0) {
50
 
                lxc_put_lock(lock);
51
 
                return -LXC_ERROR_ESRCH;
52
 
        }
53
 
 
54
 
        if (lock < 0 && lock != -LXC_ERROR_EBUSY)
55
 
                return lock;
 
48
        if (lxc_check_lock(name) < 0)
 
49
                return ret;
56
50
 
57
51
        snprintf(init, MAXPATHLEN, LXCPATH "/%s/init", name);
58
52
        fd = open(init, O_RDONLY);
60
54
                SYSERROR("failed to open init file for %s", name);
61
55
                goto out_close;
62
56
        }
63
 
        
 
57
 
64
58
        if (read(fd, val, sizeof(val)) < 0) {
65
59
                SYSERROR("failed to read %s", init);
66
60
                goto out_close;