mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
examples/x11.c: remove dead assigments of some return values
Detected by clang scan in line 212, column 9. Detected by clang scan in line 222, column 13. Detected by clang scan in line 410, column 13.
This commit is contained in:
@ -209,17 +209,17 @@ static int x11_send_receive(LIBSSH2_CHANNEL *channel, int sock)
|
|||||||
rc = libssh2_poll(fds, nfds, 0);
|
rc = libssh2_poll(fds, nfds, 0);
|
||||||
if (rc >0) {
|
if (rc >0) {
|
||||||
rc = libssh2_channel_read(channel, buf, bufsize);
|
rc = libssh2_channel_read(channel, buf, bufsize);
|
||||||
rc = write(sock, buf, rc);
|
write(sock, buf, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = select(sock+1,&set,NULL,NULL,&timeval_out);
|
rc = select(sock+1, &set, NULL, NULL, &timeval_out);
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
memset((void *)buf,0,bufsize);
|
memset((void *)buf, 0, bufsize);
|
||||||
|
|
||||||
/* Data in sock*/
|
/* Data in sock*/
|
||||||
rc = read(sock, buf, bufsize);
|
rc = read(sock, buf, bufsize);
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
rc = libssh2_channel_write(channel, buf, rc);
|
libssh2_channel_write(channel, buf, rc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
free(buf);
|
free(buf);
|
||||||
@ -229,7 +229,7 @@ static int x11_send_receive(LIBSSH2_CHANNEL *channel, int sock)
|
|||||||
|
|
||||||
free(fds);
|
free(fds);
|
||||||
free(buf);
|
free(buf);
|
||||||
if (libssh2_channel_eof (channel) == 1) {
|
if (libssh2_channel_eof(channel) == 1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -407,7 +407,7 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
rc = libssh2_poll(fds, nfds, 0);
|
rc = libssh2_poll(fds, nfds, 0);
|
||||||
if (rc >0) {
|
if (rc >0) {
|
||||||
rc = libssh2_channel_read(channel, buf,sizeof(buf));
|
libssh2_channel_read(channel, buf, sizeof(buf));
|
||||||
fprintf(stdout, "%s", buf);
|
fprintf(stdout, "%s", buf);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user