Always mention the number of the current syscall

This commit is contained in:
Pierre Pronchery 2014-10-20 21:48:28 +02:00
parent 38c1ca03c0
commit 0d0e0171b8
3 changed files with 12 additions and 24 deletions

View File

@ -82,7 +82,7 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
{
const size_t size = sizeof(stracecall) / sizeof(*stracecall);
struct user c;
long res;
unsigned long res;
static char buf[32];
if(context == NULL)
@ -98,14 +98,10 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
#else
res = -1;
#endif
if(res >= 0 && (size_t)res < size && stracecall[res] != NULL)
if(res < size && stracecall[res] != NULL)
return stracecall[res];
if(res >= 0)
{
snprintf(buf, sizeof(buf), "%s%ld", "syscall_", res);
return buf;
}
return NULL;
snprintf(buf, sizeof(buf), "%s%lx", "syscall_", res);
return buf;
}

View File

@ -62,7 +62,7 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
{
const size_t size = sizeof(stracecall) / sizeof(*stracecall);
struct user c;
long res;
unsigned long res;
static char buf[32];
if(context == NULL)
@ -78,14 +78,10 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
#else
res = -1;
#endif
if(res >= 0 && (size_t)res < size && stracecall[res] != NULL)
if(res < size && stracecall[res] != NULL)
return stracecall[res];
if(res >= 0)
{
snprintf(buf, sizeof(buf), "%s%ld", "syscall_", res);
return buf;
}
return NULL;
snprintf(buf, sizeof(buf), "%s%lx", "syscall_", res);
return buf;
}

View File

@ -137,7 +137,7 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
{
const size_t size = sizeof(stracecall) / sizeof(*stracecall);
struct user c;
long res;
unsigned long res;
static char buf[32];
if(context == NULL)
@ -153,14 +153,10 @@ char const * platform_get_syscall(pid_t pid, struct user * context)
#else
res = -1;
#endif
if(res >= 0 && (size_t)res < size && stracecall[res] != NULL)
if(res < size && stracecall[res] != NULL)
return stracecall[res];
if(res >= 0)
{
snprintf(buf, sizeof(buf), "%s%ld", "syscall_", res);
return buf;
}
return NULL;
snprintf(buf, sizeof(buf), "%s%lx", "syscall_", res);
return buf;
}