conn, event: remove variable reinitializations

master
Michael Santos 8 months ago
parent f987fd95e7
commit 2181666812

@ -1,4 +1,4 @@
/* Copyright (c) 2017, Michael Santos <michael.santos@gmail.com> /* Copyright (c) 2017-2023, Michael Santos <michael.santos@gmail.com>
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -32,7 +32,7 @@
* The alternative is hardcoding the offsets based on the libstrophe version. * The alternative is hardcoding the offsets based on the libstrophe version.
*/ */
int xmppipe_conn_fd(xmppipe_state_t *state) { int xmppipe_conn_fd(xmppipe_state_t *state) {
int fd = 0; int fd;
struct rlimit rl = {0}; struct rlimit rl = {0};
struct stat st = {0}; struct stat st = {0};

@ -1,4 +1,4 @@
/* Copyright (c) 2015-2019, Michael Santos <michael.santos@gmail.com> /* Copyright (c) 2015-2023, Michael Santos <michael.santos@gmail.com>
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -23,7 +23,7 @@ static int handle_stdin(xmppipe_state_t *state, int fd, char *buf, size_t len);
void event_loop(xmppipe_state_t *state) { void event_loop(xmppipe_state_t *state) {
int fd = STDIN_FILENO; int fd = STDIN_FILENO;
int eof = 0; int eof = 0;
char *buf = NULL; char *buf;
if (xmppipe_set_nonblock(fd) < 0) if (xmppipe_set_nonblock(fd) < 0)
return; return;
@ -107,9 +107,8 @@ static int handle_stdin(xmppipe_state_t *state, int fd, char *buf, size_t len) {
fd_set rfds; fd_set rfds;
struct timeval tv = {0}; struct timeval tv = {0};
ssize_t n = 0; ssize_t n = 0;
int rv = 0; int rv;
tv.tv_sec = 0;
tv.tv_usec = state->poll * 1000; tv.tv_usec = state->poll * 1000;
FD_ZERO(&rfds); FD_ZERO(&rfds);

Loading…
Cancel
Save