Replace g_strsignal() with g_sig2text()
This call provides a textual representation of a signal number, i.e. SIGHUP is mapped to "SIGHUP" Unit tests are also added.
This commit is contained in:
@@ -821,8 +821,12 @@ exit_status_to_str(const struct exit_status *e, char buff[], int bufflen)
|
||||
break;
|
||||
|
||||
case E_XR_SIGNAL:
|
||||
g_snprintf(buff, bufflen, "signal \"%s\"", g_strsignal(e->val));
|
||||
break;
|
||||
{
|
||||
char sigstr[MAXSTRSIGLEN];
|
||||
g_snprintf(buff, bufflen, "signal %s",
|
||||
g_sig2text(e->val, sigstr));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_snprintf(buff, bufflen, "an unexpected error");
|
||||
|
||||
Reference in New Issue
Block a user