diff options
author | Jan Safranek <jsafrane@redhat.com> | 2009-08-06 14:03:19 +0200 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-08-29 10:50:25 +0530 |
commit | 76b46b3e37dc3417e63654e262067e995c509bb4 (patch) | |
tree | fab0e2d85d3d3b0c0f29102b7894f93842eb3052 | |
parent | 0f9535116f2bb200e5d78095aafb22340c449740 (diff) | |
download | libcg-76b46b3e37dc3417e63654e262067e995c509bb4.tar.gz libcg-76b46b3e37dc3417e63654e262067e995c509bb4.tar.xz libcg-76b46b3e37dc3417e63654e262067e995c509bb4.zip |
Shorten error text of ECGOTHER
Let's reformat cgroup_strerror output from
Cgroup generic error, error message: Device or resource busy
to shorter and clearer
Device or resource busy
The patch assumes that _GNU_SOURCE is defined.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-rw-r--r-- | src/api.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -2505,10 +2505,7 @@ char *cgroup_strerror(int code) { assert((code >= ECGROUPNOTCOMPILED) && (code < ECGSENTINEL)); if (code == ECGOTHER) { - snprintf(errtext, MAXLEN, "%s, error message: %s", - cgroup_strerror_codes[code % ECGROUPNOTCOMPILED], - strerror(cgroup_get_last_errno())); - return errtext; + return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); } return cgroup_strerror_codes[code % ECGROUPNOTCOMPILED]; } |