Module: xenomai-3
Branch: master
Commit: 51ab58c067a0464b183f5a2fd318fcd9d97bc380
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=51ab58c067a0464b183f5a2fd318fcd9d97bc380

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep 23 09:11:51 2015 +0200

copperplate: preserve error number in failure path

---

 lib/copperplate/init.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c
index a9b4efd..54b4276 100644
--- a/lib/copperplate/init.c
+++ b/lib/copperplate/init.c
@@ -152,6 +152,7 @@ static int get_session_label(const char *optarg)
        char *session, *grpname, *p;
        struct group *grp;
        gid_t gid;
+       int ret;
 
        session = strdup(optarg);
        grpname = strrchr(session, '/');
@@ -172,8 +173,9 @@ static int get_session_label(const char *optarg)
        }
 
        if (grp == NULL) {
+               ret = errno ? -errno : -EINVAL;
                warning("invalid group %s", grpname);
-               return errno ? -errno : -EINVAL;
+               return ret;
        }
 
        __copperplate_setup_data.session_gid = grp->gr_gid;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to