Skip to content

Commit

Permalink
fix(driver): avoid mixed declarations
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo authored and poiana committed Mar 22, 2024
1 parent a9e5612 commit b3eb1ef
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions driver/ppm_fillers.c
Original file line number Diff line number Diff line change
Expand Up @@ -5710,12 +5710,13 @@ int f_sys_dup_e(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

/*
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand All @@ -5726,6 +5727,7 @@ int f_sys_dup_x(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

int64_t retval = (int64_t)syscall_get_return_value(current, args->regs);
res = val_to_ring(args, retval, 0, false, 0);
Expand All @@ -5735,7 +5737,7 @@ int f_sys_dup_x(struct event_filler_arguments *args)
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand All @@ -5746,12 +5748,13 @@ int f_sys_dup2_e(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

/*
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand All @@ -5762,6 +5765,7 @@ int f_sys_dup2_x(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

int64_t retval = (int64_t)syscall_get_return_value(current, args->regs);
res = val_to_ring(args, retval, 0, false, 0);
Expand All @@ -5771,7 +5775,7 @@ int f_sys_dup2_x(struct event_filler_arguments *args)
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand All @@ -5790,12 +5794,13 @@ int f_sys_dup3_e(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

/*
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand All @@ -5806,6 +5811,7 @@ int f_sys_dup3_x(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int32_t fd = 0;

int64_t retval = (int64_t)syscall_get_return_value(current, args->regs);
res = val_to_ring(args, retval, 0, false, 0);
Expand All @@ -5815,7 +5821,7 @@ int f_sys_dup3_x(struct event_filler_arguments *args)
* oldfd
*/
syscall_get_arguments_deprecated(args, 0, 1, &val);
int32_t fd = (int32_t) val;
fd = (int32_t) val;
res = val_to_ring(args, (int64_t)fd, 0, false, 0);
CHECK_RES(res);

Expand Down

0 comments on commit b3eb1ef

Please sign in to comment.