]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Improved error reporting in frsh_init()
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 10 May 2009 13:57:55 +0000 (15:57 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 10 May 2009 13:57:55 +0000 (15:57 +0200)
If the some function return -1, then frsh_init() returns the value of
errno.

frsh_api/frsh_core.c

index f7199ddb4bd1767365151fae107eec3c7818d7ec..111d6d4d3aa4232241a1dd8a4a838919322e32fa 100644 (file)
@@ -100,8 +100,8 @@ int frsh_init()
        
        frsh_forb_global.orb = forb_init(NULL, NULL, "frsh");
        if (!frsh_forb_global.orb) {
-               if (errno) return errno;
-               else return -1;
+               ret = errno;
+               goto err;
        }
 
        frsh_forb_global.fcb = forb_resolve_reference(frsh_forb_global.orb,
@@ -151,6 +151,7 @@ int frsh_init()
        
        return 0;
 err:
+       if (ret == -1) ret = errno;
        return ret;
 }