mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-29 06:50:38 +03:00
devmapper-event: always initialize timeout
Before calling select, always set all struct members of timeout.
This commit is contained in:
parent
08e7de986c
commit
db0045dfc9
@ -291,7 +291,6 @@ static int _daemon_write(struct dm_event_fifos *fifos,
|
||||
uint32_t *header = alloca(size);
|
||||
char *buf = (char *)header;
|
||||
char drainbuf[128];
|
||||
struct timeval tval = { 0, 0 };
|
||||
|
||||
header[0] = htonl(msg->cmd);
|
||||
header[1] = htonl(msg->size);
|
||||
@ -299,9 +298,9 @@ static int _daemon_write(struct dm_event_fifos *fifos,
|
||||
|
||||
/* drain the answer fifo */
|
||||
while (1) {
|
||||
struct timeval tval = { .tv_usec = 100 };
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(fifos->server, &fds);
|
||||
tval.tv_usec = 100;
|
||||
ret = select(fifos->server + 1, &fds, NULL, NULL, &tval);
|
||||
if ((ret < 0) && (errno != EINTR)) {
|
||||
log_error("Unable to talk to event daemon");
|
||||
|
Loading…
x
Reference in New Issue
Block a user