Mercurial > dropbear
comparison svr-chansession.c @ 658:d4d0279710b9
- Initialise sa_mask properly
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 04 Dec 2011 05:41:46 +0800 |
parents | 16af1decaf4c |
children | 0ad95abf8d3c |
comparison
equal
deleted
inserted
replaced
657:16af1decaf4c | 658:d4d0279710b9 |
---|---|
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 sa_chld.sa_handler = sesssigchild_handler; | 138 sa_chld.sa_handler = sesssigchild_handler; |
139 sa_chld.sa_flags = SA_NOCLDSTOP; | 139 sa_chld.sa_flags = SA_NOCLDSTOP; |
140 sa_chld.sa_mask = 0; | 140 sigemptyset(&sa_chld.sa_mask); |
141 sigaction(SIGCHLD, &sa_chld, NULL); | 141 sigaction(SIGCHLD, &sa_chld, NULL); |
142 TRACE(("leave sigchld handler")) | 142 TRACE(("leave sigchld handler")) |
143 } | 143 } |
144 | 144 |
145 /* send the exit status or the signal causing termination for a session */ | 145 /* send the exit status or the signal causing termination for a session */ |
979 svr_ses.childpids[0].chansess = NULL; | 979 svr_ses.childpids[0].chansess = NULL; |
980 svr_ses.childpidsize = 1; | 980 svr_ses.childpidsize = 1; |
981 svr_ses.lastexit.exitpid = -1; /* Nothing has exited yet */ | 981 svr_ses.lastexit.exitpid = -1; /* Nothing has exited yet */ |
982 sa_chld.sa_handler = sesssigchild_handler; | 982 sa_chld.sa_handler = sesssigchild_handler; |
983 sa_chld.sa_flags = SA_NOCLDSTOP; | 983 sa_chld.sa_flags = SA_NOCLDSTOP; |
984 sigemptyset(&sa_chld.sa_mask); | |
984 if (sigaction(SIGCHLD, &sa_chld, NULL) < 0) { | 985 if (sigaction(SIGCHLD, &sa_chld, NULL) < 0) { |
985 dropbear_exit("signal() error"); | 986 dropbear_exit("signal() error"); |
986 } | 987 } |
987 | 988 |
988 } | 989 } |