eloop: silence gcc warning
Gcc warns about an uninitialized variable (which technically is correct). However, there is really no way this can really happen. But to make gcc happy (and to enhance code readability) we now depend on !sig whether the list-search was successful. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
3b795bbe6a
commit
93b0d3e80c
@ -1677,7 +1677,7 @@ void ev_eloop_rm_counter(struct ev_counter *cnt)
|
||||
int ev_eloop_register_signal_cb(struct ev_eloop *loop, int signum,
|
||||
ev_signal_shared_cb cb, void *data)
|
||||
{
|
||||
struct ev_signal_shared *sig;
|
||||
struct ev_signal_shared *sig = NULL;
|
||||
int ret;
|
||||
struct kmscon_dlist *iter;
|
||||
|
||||
@ -1692,7 +1692,7 @@ int ev_eloop_register_signal_cb(struct ev_eloop *loop, int signum,
|
||||
break;
|
||||
}
|
||||
|
||||
if (iter == &loop->sig_list) {
|
||||
if (!sig) {
|
||||
ret = signal_new(&sig, loop, signum);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user