~serge-hallyn/ubuntu/natty/lxc/lxc-fix-3bugs

« back to all changes in this revision

Viewing changes to test/lxc_low_monitor.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:
51
51
        if (!name)
52
52
                usage(argv[0]);
53
53
 
54
 
        fd = lxc_monitor_open(name);
 
54
        fd = lxc_monitor_open();
55
55
        if (fd < 0) {
56
56
                fprintf(stderr, "failed to open monitor\n");
57
57
                return -1;
58
58
        }
59
59
        
60
60
        for (;;) {
61
 
                lxc_state_t state;
62
 
                lxc_monitor_read(fd, &state);
63
 
                printf("received changing state '%s'\n", lxc_state2str(state));
 
61
                struct lxc_msg msg;
 
62
                lxc_monitor_read(fd, &msg);
 
63
                if (msg.type == lxc_msg_state) {
 
64
                        printf("received changing state '%s'\n", lxc_state2str(msg.value));
 
65
                }
64
66
        }
65
67
}