Hi, If failing to open /etc/cgrules.conf in cgroup_parse_rules(), rl_lock should be unlocked. This patch fixes the code for doing it.
Thanks Ken'ichi Ohmichi Signed-off-by: Ken'ichi Ohmichi <[email protected]> --- diff --git a/src/api.c b/src/api.c index e29c966..4902c45 100644 --- a/src/api.c +++ b/src/api.c @@ -318,7 +318,8 @@ static int cgroup_parse_rules(bool cache, uid_t muid, gid_t mgid) " error: %s\n", CGRULES_CONF_FILE, strerror(errno)); last_errno = errno; - goto finish; + ret = ECGOTHER; + goto unlock; } buff = calloc(CGROUP_RULE_MAXLINE, sizeof(char)); @@ -326,7 +327,7 @@ static int cgroup_parse_rules(bool cache, uid_t muid, gid_t mgid) cgroup_dbg("Out of memory? Error: %s\n", strerror(errno)); last_errno = errno; ret = ECGOTHER; - goto close_unlock; + goto close; } /* Determine which list we're using. */ @@ -542,10 +543,10 @@ parsefail: cleanup: free(buff); -close_unlock: +close: fclose(fp); +unlock: pthread_rwlock_unlock(&rl_lock); -finish: return ret; } ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
