On Wed, May 13, 2009 at 09:59:31AM +0900, Ken'ichi Ohmichi wrote:
>
> 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]>
Thanks, merged!
> ---
> 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;
> }
--
regards,
Dhaval
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel