Fix some c99 struct initializer uninitialized member warnings

that clang detects and GCC misses.
This commit is contained in:
Nicholas J. Kain 2015-02-13 23:25:42 -05:00
parent 702d8b0c5b
commit 04840c261d
3 changed files with 5 additions and 3 deletions

View File

@ -109,7 +109,7 @@ struct arp_data {
static struct arp_data garp = { static struct arp_data garp = {
.state = AS_NONE, .state = AS_NONE,
.wake_ts = { -1, -1, -1, -1, -1 }, .wake_ts = { -1, -1, -1, -1, -1 },
.send_stats = {{0},{0},{0}}, .send_stats = {{0,0},{0,0},{0,0}},
.last_conflict_ts = 0, .last_conflict_ts = 0,
.gw_check_initpings = 0, .gw_check_initpings = 0,
.arp_check_start_ts = 0, .arp_check_start_ts = 0,

View File

@ -186,7 +186,8 @@ static void setup_signals_ndhc(void)
static void signal_dispatch(void) static void signal_dispatch(void)
{ {
struct signalfd_siginfo si = {0}; struct signalfd_siginfo si;
memset(&si, 0, sizeof si);
ssize_t r = safe_read(cs.signalFd, (char *)&si, sizeof si); ssize_t r = safe_read(cs.signalFd, (char *)&si, sizeof si);
if (r < 0) { if (r < 0) {
log_error("%s: ndhc: error reading from signalfd: %s", log_error("%s: ndhc: error reading from signalfd: %s",

View File

@ -77,7 +77,8 @@ int setup_signals_subprocess(void)
void signal_dispatch_subprocess(int sfd, const char pname[static 1]) void signal_dispatch_subprocess(int sfd, const char pname[static 1])
{ {
struct signalfd_siginfo si = {0}; struct signalfd_siginfo si;
memset(&si, 0, sizeof si);
ssize_t r = safe_read(sfd, (char *)&si, sizeof si); ssize_t r = safe_read(sfd, (char *)&si, sizeof si);
if (r < 0) { if (r < 0) {
log_error("%s: %s: error reading from signalfd: %s", log_error("%s: %s: error reading from signalfd: %s",