From 76b46b3e37dc3417e63654e262067e995c509bb4 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 6 Aug 2009 14:03:19 +0200 Subject: [PATCH] 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 Signed-off-by: Dhaval Giani --- src/api.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/api.c b/src/api.c index 48476788..fef0e761 100644 --- a/src/api.c +++ b/src/api.c @@ -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]; } -- 2.47.2