[lxc-devel] [lxc/lxc] 13bc2f: lxc_*.c: don't exit with -1

GitHub noreply at github.com
Mon Apr 7 21:19:26 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 13bc2fd2370f8e3778d81f58ac8dda5746550a4f
      https://github.com/lxc/lxc/commit/13bc2fd2370f8e3778d81f58ac8dda5746550a4f
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-04-07 (Mon, 07 Apr 2014)

  Changed paths:
    M doc/lxc-stop.sgml.in
    M src/lxc/lxc_attach.c
    M src/lxc/lxc_cgroup.c
    M src/lxc/lxc_clone.c
    M src/lxc/lxc_config.c
    M src/lxc/lxc_console.c
    M src/lxc/lxc_destroy.c
    M src/lxc/lxc_execute.c
    M src/lxc/lxc_freeze.c
    M src/lxc/lxc_init.c
    M src/lxc/lxc_monitor.c
    M src/lxc/lxc_monitord.c
    M src/lxc/lxc_snapshot.c
    M src/lxc/lxc_stop.c
    M src/lxc/lxc_unfreeze.c
    M src/lxc/lxc_unshare.c
    M src/lxc/lxc_usernsexec.c
    M src/lxc/lxc_wait.c

  Log Message:
  -----------
  lxc_*.c: don't exit with -1

In this patch I tried to stick with each file's coding style, however I
think we should probably change that.  Every main() should always not
return and only exit;  they should always return EXIT_SUCCESS or EXIT_FAILURE
with the only exceptions being cases where we are returning a child's
exit status (lxc_execute, lxc_attach, lxc_init).

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 6d35844184a450ff36fe72cddc17c193ca3b70b7
      https://github.com/lxc/lxc/commit/6d35844184a450ff36fe72cddc17c193ca3b70b7
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-04-07 (Mon, 07 Apr 2014)

  Changed paths:
    M src/lxc/cgmanager.c

  Log Message:
  -----------
  cgmanager: cgm_get: len = 0 is a query for length only

The caller might (like lxc-test-startone does) pass in a valid
(or invalid) buffer and 0 length.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/8dac6e74c442...6d35844184a4


More information about the lxc-devel mailing list