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>
{
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];
}