]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
arguments: should return negative number when error happens
authorQiang Huang <h.huangqiang@huawei.com>
Mon, 3 Jun 2013 01:48:12 +0000 (09:48 +0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 3 Jun 2013 15:52:39 +0000 (10:52 -0500)
We should return -ENOMEM instead of ENOMEM when realloc fails.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/arguments.c

index 5f1c1af66b48f22ff9182590f857cf7bb245090d..8a8d3067e2e02410c4e4b57874f002dfb226cbcd 100644 (file)
@@ -164,7 +164,7 @@ static int lxc_arguments_lxcpath_add(struct lxc_arguments *args,
                                 sizeof(args->lxcpath[0]));
        if (args->lxcpath == NULL) {
                lxc_error(args, "no memory");
-               return ENOMEM;
+               return -ENOMEM;
        }
        args->lxcpath[args->lxcpath_cnt++] = lxcpath;
        return 0;