diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-14 00:51:08 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-05-14 00:51:08 +0200 |
commit | b23b3f1d9951df3ea7cc074de40db04bdf0d3a1c (patch) | |
tree | d4fe8f4c4aa71c6cebe7d1d92dc25ea145d98cd1 /examples/exec.c | |
parent | 46b249f5ce552bba2e0a170cb0b8052b1419924b (diff) | |
download | libssh-b23b3f1d9951df3ea7cc074de40db04bdf0d3a1c.tar.gz libssh-b23b3f1d9951df3ea7cc074de40db04bdf0d3a1c.tar.xz libssh-b23b3f1d9951df3ea7cc074de40db04bdf0d3a1c.zip |
Sanitize libssh namespace + legacy wrappers
Diffstat (limited to 'examples/exec.c')
-rw-r--r-- | examples/exec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/exec.c b/examples/exec.c index bff49fd..1f6fa29 100644 --- a/examples/exec.c +++ b/examples/exec.c @@ -15,41 +15,41 @@ int main(void) { return 1; } - channel = channel_new(session);; + channel = ssh_channel_new(session);; if (channel == NULL) { ssh_disconnect(session); return 1; } - rc = channel_open_session(channel); + rc = ssh_channel_open_session(channel); if (rc < 0) { - channel_close(channel); + ssh_channel_close(channel); ssh_disconnect(session); return 1; } - rc = channel_request_exec(channel, "ps aux"); + rc = ssh_channel_request_exec(channel, "ps aux"); if (rc < 0) { - channel_close(channel); + ssh_channel_close(channel); ssh_disconnect(session); return 1; } - while ((rc = channel_read(channel, buffer, sizeof(buffer), 0)) > 0) { + while ((rc = ssh_channel_read(channel, buffer, sizeof(buffer), 0)) > 0) { if (fwrite(buffer, 1, rc, stdout) != (unsigned int) rc) { return 1; } } if (rc < 0) { - channel_close(channel); + ssh_channel_close(channel); ssh_disconnect(session); return 1; } - channel_send_eof(channel); - channel_close(channel); + ssh_channel_send_eof(channel); + ssh_channel_close(channel); ssh_disconnect(session); |