aboutsummaryrefslogtreecommitdiff
path: root/sample.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-04 10:06:49 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-04 10:06:49 +0000
commit152da0702351dce04b62999aa98efc57fbda4489 (patch)
tree99a98d1ee0b4e29d9c6616c9cbe0496ae837487a /sample.c
parentdda7808851079f75042fd73850adb336eb53c8e8 (diff)
downloadlibssh-152da0702351dce04b62999aa98efc57fbda4489.tar.gz
libssh-152da0702351dce04b62999aa98efc57fbda4489.tar.xz
libssh-152da0702351dce04b62999aa98efc57fbda4489.zip
Implement channel_read() as a POSIX like function.
Create channel_read_buffer() to have the old version still available. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@700 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'sample.c')
-rw-r--r--sample.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample.c b/sample.c
index 13f4e921..67d17657 100644
--- a/sample.c
+++ b/sample.c
@@ -188,7 +188,7 @@ static void select_loop(SSH_SESSION *session,CHANNEL *channel){
}
if(channels[0]){
while(channel && channel_is_open(channel) && channel_poll(channel,0)){
- lus=channel_read(channel,readbuf,0,0);
+ lus=channel_read_buffer(channel,readbuf,0,0);
if(lus==-1){
fprintf(stderr, "Error reading channel: %s\n",
ssh_get_error(session));
@@ -204,7 +204,7 @@ static void select_loop(SSH_SESSION *session,CHANNEL *channel){
write(1,buffer_get(readbuf),lus);
}
while(channel && channel_is_open(channel) && channel_poll(channel,1)){ /* stderr */
- lus=channel_read(channel,readbuf,0,1);
+ lus=channel_read_buffer(channel,readbuf,0,1);
if(lus==-1){
fprintf(stderr, "Error reading channel: %s\n",
ssh_get_error(session));