> I prefer to write this message as cgroup_err (and "Warning" -> "Error").
> This message is very useful to create relevant cgcconfig.conf file. (And I 
> prefer no to change the default loglevel to err ). And by default now the 
> message will not be shown this way.
> 
> The same apply to the other hunks.
Ok, updated.

---

Useful for understanding what's going on in the cases like the following:
group some_group {
        perm {
                task {
                        uid = user_doesnot_exist;
                        gid = group_doesnot_exist;
                }
                admin {
                        uid = user_doesnot_exist;
                        gid = group_doesnot_exist;
                }
        }
}

Signed-off-by: Stanislav Fomichev <stfomic...@yandex-team.ru>
---
 src/config.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/config.c b/src/config.c
index ac844a7ae30c..f2a9e54a8971 100644
--- a/src/config.c
+++ b/src/config.c
@@ -350,6 +350,8 @@ int config_group_task_perm(char *perm_type, char *value, 
int flag)
                        getpwnam_r(value, pw, buffer, CGROUP_BUFFER_LEN,
                                                                &pw_buffer);
                        if (pw_buffer == NULL) {
+                               cgroup_err("Error: failed to get %s uid\n",
+                                          value);
                                free(pw);
                                goto group_task_error;
                        }
@@ -371,6 +373,8 @@ int config_group_task_perm(char *perm_type, char *value, 
int flag)
                                        CGROUP_BUFFER_LEN, &group_buffer);
 
                        if (group_buffer == NULL) {
+                               cgroup_err("Error: failed to get %s gid\n",
+                                          value);
                                free(group);
                                goto group_task_error;
                        }
@@ -462,6 +466,8 @@ int config_group_admin_perm(char *perm_type, char *value, 
int flag)
                        getpwnam_r(value, pw, buffer, CGROUP_BUFFER_LEN,
                                                                &pw_buffer);
                        if (pw_buffer == NULL) {
+                               cgroup_err("Error: failed to get %s uid\n",
+                                          value);
                                free(pw);
                                goto admin_error;
                        }
@@ -483,6 +489,8 @@ int config_group_admin_perm(char *perm_type, char *value, 
int flag)
                                        CGROUP_BUFFER_LEN, &group_buffer);
 
                        if (group_buffer == NULL) {
+                               cgroup_err("Error: failed to get %s gid\n",
+                                          value);
                                free(group);
                                goto admin_error;
                        }

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to