Always mention the number of the current syscall
This commit is contained in:
parent
38c1ca03c0
commit
0d0e0171b8
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user