Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5144fa28 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Add missing signal codes to get_sigcode."

parents 523e21d3 8f7d4430
Loading
Loading
Loading
Loading
+25 −0
Original line number Original line Diff line number Diff line
@@ -84,6 +84,7 @@ static const char *get_signame(int sig)


static const char *get_sigcode(int signo, int code)
static const char *get_sigcode(int signo, int code)
{
{
    // Try the signal-specific codes...
    switch (signo) {
    switch (signo) {
    case SIGILL:
    case SIGILL:
        switch (code) {
        switch (code) {
@@ -122,7 +123,31 @@ static const char *get_sigcode(int signo, int code)
        case SEGV_ACCERR: return "SEGV_ACCERR";
        case SEGV_ACCERR: return "SEGV_ACCERR";
        }
        }
        break;
        break;
    case SIGTRAP:
        switch (code) {
        case TRAP_BRKPT: return "TRAP_BRKPT";
        case TRAP_TRACE: return "TRAP_TRACE";
        }
        break;
    }
    // Then the other codes...
    switch (code) {
    case SI_USER:    return "SI_USER";
#if defined(SI_KERNEL)
    case SI_KERNEL:  return "SI_KERNEL";
#endif
    case SI_QUEUE:   return "SI_QUEUE";
    case SI_TIMER:   return "SI_TIMER";
    case SI_MESGQ:   return "SI_MESGQ";
    case SI_ASYNCIO: return "SI_ASYNCIO";
#if defined(SI_SIGIO)
    case SI_SIGIO:   return "SI_SIGIO";
#endif
#if defined(SI_TKILL)
    case SI_TKILL:   return "SI_TKILL";
#endif
    }
    }
    // Then give up...
    return "?";
    return "?";
}
}