Skip to content

Commit

Permalink
mxqd: Fix uninitialized warning
Browse files Browse the repository at this point in the history
gcc shows "warning: ‘status’ may be used uninitialized in this function
[-Wmaybe-uninitialized]" on higher optimization levels.

The variable will not be unitialized, if the code logic and the kernel
process modell and system calls work as expected, but the compiler
doesn't know about that.

Initialize variable to a dont-care value to silence the compiler.
  • Loading branch information
donald committed Mar 21, 2022
1 parent b2e51b9 commit c9815df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ static int is_reaper(pid_t pid) {
int reaper_process(struct mxq_server *server,struct mxq_group_list *glist, struct mxq_job *job) {
pid_t pid;
struct rusage rusage;
int status;
int status = 0;
pid_t waited_pid;
int waited_status;
struct timeval now;
Expand Down

0 comments on commit c9815df

Please sign in to comment.