Skip to content

Commit d4efc80

Browse files
Andreagit97poiana
authored andcommitted
fix: fix some warnings as errors
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
1 parent 62bb482 commit d4efc80

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

test/drivers/event_class/network_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
/*=============================== UNIX ===========================*/
6565

6666
/* Max length socket unix path. */
67-
#define MAX_SUN_PATH 109
67+
#define MAX_SUN_PATH 108
6868

6969
/* Unix Client: the `xyzxe-` prefix is used to avoid name collisions */
7070
#define UNIX_CLIENT "/tmp/xyzxe-client"

test/drivers/helpers/proc_parsing.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
* in which we don't need them all.
1313
*/
1414
struct proc_info {
15-
uint32_t tty;
16-
pid_t ppid; /* The PID of the parent of this process. */
17-
pid_t pgid; /* The process group ID of the process. */
18-
char raw_args[MAX_NUM_ARGS][MAX_PATH];
19-
const char* args[MAX_NUM_ARGS];
20-
uint32_t uid;
21-
uint32_t gid;
22-
uint32_t vpid;
23-
uint32_t vtid;
24-
struct rlimit file_rlimit;
25-
uint32_t loginuid;
26-
char exepath[MAX_PATH];
15+
uint32_t tty = 0;
16+
pid_t ppid = 0; /* The PID of the parent of this process. */
17+
pid_t pgid = 0; /* The process group ID of the process. */
18+
char raw_args[MAX_NUM_ARGS][MAX_PATH] = {};
19+
const char* args[MAX_NUM_ARGS] = {};
20+
uint32_t uid = 0;
21+
uint32_t gid = 0;
22+
uint32_t vpid = 0;
23+
uint32_t vtid = 0;
24+
struct rlimit file_rlimit = {0, 0};
25+
uint32_t loginuid = 0;
26+
char exepath[MAX_PATH] = {};
2727
};
2828

2929
bool get_proc_info(pid_t pid, proc_info* info);

test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ TEST(GenericTracepoints, sched_proc_exec) {
4242
/* We need to use `SIGCHLD` otherwise the parent won't receive any signal
4343
* when the child terminates.
4444
*/
45-
clone_args cl_args = {0};
45+
clone_args cl_args = {};
4646
cl_args.exit_signal = SIGCHLD;
4747
pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args));
4848

@@ -182,7 +182,7 @@ TEST(GenericTracepoints, sched_proc_exec_success_memfd) {
182182
/* We need to use `SIGCHLD` otherwise the parent won't receive any signal
183183
* when the child terminates.
184184
*/
185-
clone_args cl_args = {0};
185+
clone_args cl_args = {};
186186
cl_args.exit_signal = SIGCHLD;
187187
pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args));
188188

test/drivers/test_suites/generic_tracepoints_suite/sched_process_fork.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3) {
1414
/*=============================== TRIGGER SYSCALL ===========================*/
1515

1616
/* Here we scan the parent just to obtain some info for the child */
17-
struct proc_info info = {0};
17+
struct proc_info info = {};
1818
pid_t pid = ::getpid();
1919
if(!get_proc_info(pid, &info)) {
2020
FAIL() << "Unable to get all the info from proc" << std::endl;
@@ -23,7 +23,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3) {
2323
/* We need to use `SIGCHLD` otherwise the parent won't receive any signal
2424
* when the child terminates. We use `CLONE_FILES` just to test the flags.
2525
*/
26-
clone_args cl_args = {0};
26+
clone_args cl_args = {};
2727
cl_args.flags = CLONE_FILES;
2828
cl_args.exit_signal = SIGCHLD;
2929
pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args));
@@ -122,7 +122,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_create_child_with_2_threads
122122
pid_t p1_t1 = 61001;
123123
pid_t p1_t2 = 61004;
124124

125-
clone_args cl_args_parent = {0};
125+
clone_args cl_args_parent = {};
126126
cl_args_parent.set_tid = (uint64_t)&p1_t1;
127127
cl_args_parent.set_tid_size = 1;
128128
cl_args_parent.exit_signal = SIGCHLD;
@@ -131,7 +131,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_create_child_with_2_threads
131131
/* Create a child process that will spawn a new thread */
132132
if(ret_pid == 0) {
133133
/* Spawn a new thread */
134-
clone_args cl_args_child = {0};
134+
clone_args cl_args_child = {};
135135
cl_args_child.set_tid = (uint64_t)&p1_t2;
136136
cl_args_child.set_tid_size = 1;
137137
/* CLONE_PARENT has no additional effects if we are spawning a thread
@@ -223,14 +223,14 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_clone_parent_flag) {
223223
pid_t p1_t1 = 61024;
224224
pid_t p2_t1 = 60128;
225225

226-
clone_args cl_args_parent = {0};
226+
clone_args cl_args_parent = {};
227227
cl_args_parent.set_tid = (uint64_t)&p1_t1;
228228
cl_args_parent.set_tid_size = 1;
229229
cl_args_parent.exit_signal = SIGCHLD;
230230
pid_t ret_pid = syscall(__NR_clone3, &cl_args_parent, sizeof(cl_args_parent));
231231

232232
if(ret_pid == 0) {
233-
clone_args cl_args_child = {0};
233+
clone_args cl_args_child = {};
234234
cl_args_child.set_tid = (uint64_t)&p2_t1;
235235
cl_args_child.set_tid_size = 1;
236236
cl_args_child.flags = CLONE_PARENT;
@@ -327,7 +327,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_from_ch
327327

328328
/* Here we create a child process in a new namespace. */
329329
pid_t p1_t1[2] = {1, 61032};
330-
clone_args cl_args = {0};
330+
clone_args cl_args = {};
331331
cl_args.set_tid = (uint64_t)&p1_t1;
332332
cl_args.set_tid_size = 2;
333333
cl_args.flags = CLONE_NEWPID;
@@ -411,7 +411,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_create_
411411
/* Please note that a process can have the same pid number in different namespaces */
412412
pid_t p1_t2[2] = {61036, 61036};
413413

414-
clone_args cl_args = {0};
414+
clone_args cl_args = {};
415415
cl_args.set_tid = (uint64_t)&p1_t1;
416416
cl_args.set_tid_size = 2;
417417
cl_args.flags = CLONE_NEWPID;
@@ -420,7 +420,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_create_
420420

421421
if(ret_pid == 0) {
422422
/* Spawn a new thread */
423-
clone_args cl_args_child = {0};
423+
clone_args cl_args_child = {};
424424
cl_args_child.set_tid = (uint64_t)&p1_t2;
425425
cl_args_child.set_tid_size = 2;
426426
cl_args_child.flags = CLONE_THREAD | CLONE_SIGHAND | CLONE_VM | CLONE_VFORK;
@@ -502,7 +502,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone) {
502502
/*=============================== TRIGGER SYSCALL ===========================*/
503503

504504
/* Here we scan the parent just to obtain some info for the child */
505-
struct proc_info info = {0};
505+
struct proc_info info = {};
506506
pid_t pid = ::getpid();
507507
if(!get_proc_info(pid, &info)) {
508508
FAIL() << "Unable to get all the info from proc" << std::endl;
@@ -611,7 +611,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_fork) {
611611
/*=============================== TRIGGER SYSCALL ===========================*/
612612

613613
/* Here we scan the parent just to obtain some info for the child */
614-
struct proc_info info = {0};
614+
struct proc_info info = {};
615615
pid_t pid = ::getpid();
616616
if(!get_proc_info(pid, &info)) {
617617
FAIL() << "Unable to get all the info from proc" << std::endl;

test/drivers/test_suites/syscall_enter_suite/connect_e.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ TEST(SyscallEnter, connectE_UNIX_failure) {
169169
*/
170170
#define UNIX_LONG_PATH \
171171
"/unix_socket/test/too_long/too_long/too_long/too_long/unix_socket/test/too_long/too_long/" \
172-
"too_long/too_longgg*"
172+
"too_long/too_longgg"
173173
#define EXPECTED_UNIX_LONG_PATH \
174174
"/unix_socket/test/too_long/too_long/too_long/too_long/unix_socket/test/too_long/too_long/" \
175-
"too_long/too_longgg"
175+
"too_long/too_longg"
176176

177177
TEST(SyscallEnter, connectE_UNIX_max_path_failure) {
178178
auto evt_test = get_syscall_event_test(__NR_connect, ENTER_EVENT);

0 commit comments

Comments
 (0)