1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <stdio.h>
#include <signal.h>
#include <jim-signal.h>
#include <jim.h>
/* Implement trivial Jim_SignalId() just good enough for JimMakeErrorCode() in [exec] */
/* This works for mingw, but is not really portable */
#ifndef SIGPIPE
#define SIGPIPE 13
#endif
#ifndef SIGINT
#define SIGINT 2
#endif
const char *Jim_SignalId(int sig)
{
static char buf[10];
switch (sig) {
case SIGINT: return "SIGINT";
case SIGPIPE: return "SIGPIPE";
}
snprintf(buf, sizeof(buf), "%d", sig);
return buf;
}
|