On 06/15/2009 05:21 PM, Dhaval Giani wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=502687  mentioned that the 
> directory
> was not getting created when a cgconfig start was being run.
>
> This is was because we failed the mkdir. The mkdir for directories at depth
> was not succeeding.
>
> Signed-off-by: Dhaval Giani<[email protected]>
>
> ---
>   src/api.c                |    2 +-
>   src/config.c             |    3 +--
>   src/libcgroup-internal.h |    1 +
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> Index: libcg/src/api.c
> ===================================================================
> --- libcg.orig/src/api.c      2009-06-15 14:27:39.000000000 +0530
> +++ libcg/src/api.c   2009-06-15 16:08:10.000000000 +0530
> @@ -872,7 +872,7 @@
>    * cg_mkdir_p, emulate the mkdir -p command (recursively creating paths)
>    * @path: path to create
>    */
> -static int cg_mkdir_p(const char *path)
> +int cg_mkdir_p(const char *path)
>   {
>       char *real_path = NULL;
>       char *wd = NULL;
> Index: libcg/src/config.c
> ===================================================================
> --- libcg.orig/src/config.c   2009-05-18 15:34:44.000000000 +0530
> +++ libcg/src/config.c        2009-06-15 16:08:10.000000000 +0530
> @@ -371,8 +371,7 @@
>               }
>
>               if (errno == ENOENT) {
> -                     ret = mkdir(curr->path,
> -                                     S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
> +                     ret = cg_mkdir_p(curr->path);
>                       if (ret<  0) {

This condition is wrong now, cg_mkdir_p returns > 0 on error

>                               last_errno = errno;
>                               return ECGOTHER;
You should return 'ret' here.

> Index: libcg/src/libcgroup-internal.h
> ===================================================================
> --- libcg.orig/src/libcgroup-internal.h       2009-06-15 14:27:39.000000000 
> +0530
> +++ libcg/src/libcgroup-internal.h    2009-06-15 16:09:32.000000000 +0530
> @@ -91,6 +91,7 @@
>   /* Internal API */
>   char *cg_build_path(char *name, char *path, char *type);
>   int cgroup_get_uid_gid_from_procfs(pid_t pid, uid_t *euid, gid_t *egid);
> +int cg_mkdir_p(const char *path);
>
>
>   /*
>
>
>
> ------------------------------------------------------------------------------
> 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


------------------------------------------------------------------------------
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

Reply via email to