Initialize sa_mask in sigaction structure
authorSteven Luo <steven+maemo@steven676.net>
Sun, 13 Dec 2009 08:29:04 +0000 (00:29 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Sun, 13 Dec 2009 08:29:04 +0000 (00:29 -0800)
Found by valgrind.

main.c

diff --git a/main.c b/main.c
index 9033117..a366fe7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -169,6 +169,7 @@ int main() {
        if (ctx.continuous_mode) {
                struct sigaction act;
                act.sa_flags = SA_RESTART;
        if (ctx.continuous_mode) {
                struct sigaction act;
                act.sa_flags = SA_RESTART;
+               act.sa_mask = 0;
 
                act.sa_handler = waitforzombies;
                if (sigaction(SIGCHLD, &act, NULL) == -1) {
 
                act.sa_handler = waitforzombies;
                if (sigaction(SIGCHLD, &act, NULL) == -1) {