mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
Fix select loop in sample
This commit is contained in:
@ -332,7 +332,7 @@ static void select_loop(ssh_session session,ssh_channel channel){
|
|||||||
channels[0]=NULL;
|
channels[0]=NULL;
|
||||||
}
|
}
|
||||||
if(outchannels[0]){
|
if(outchannels[0]){
|
||||||
while(channel && channel_is_open(channel) && channel_poll(channel,0)>0){
|
while(channel && channel_is_open(channel) && channel_poll(channel,0)!=0){
|
||||||
lus=channel_read(channel,buffer,sizeof(buffer),0);
|
lus=channel_read(channel,buffer,sizeof(buffer),0);
|
||||||
if(lus==-1){
|
if(lus==-1){
|
||||||
fprintf(stderr, "Error reading channel: %s\n",
|
fprintf(stderr, "Error reading channel: %s\n",
|
||||||
@ -351,7 +351,7 @@ static void select_loop(ssh_session session,ssh_channel channel){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(channel && channel_is_open(channel) && channel_poll(channel,1)>0){ /* stderr */
|
while(channel && channel_is_open(channel) && channel_poll(channel,1)!=0){ /* stderr */
|
||||||
lus=channel_read(channel,buffer,sizeof(buffer),1);
|
lus=channel_read(channel,buffer,sizeof(buffer),1);
|
||||||
if(lus==-1){
|
if(lus==-1){
|
||||||
fprintf(stderr, "Error reading channel: %s\n",
|
fprintf(stderr, "Error reading channel: %s\n",
|
||||||
|
Reference in New Issue
Block a user