mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
channel: Reformat ssh_channel_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -76,10 +76,11 @@ static ssh_channel channel_from_msg(ssh_session session, ssh_buffer packet);
|
||||
*
|
||||
* @return A pointer to a newly allocated channel, NULL on error.
|
||||
*/
|
||||
ssh_channel ssh_channel_new(ssh_session session) {
|
||||
ssh_channel ssh_channel_new(ssh_session session)
|
||||
{
|
||||
ssh_channel channel = NULL;
|
||||
|
||||
if(session == NULL) {
|
||||
if (session == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -109,10 +110,12 @@ ssh_channel ssh_channel_new(ssh_session session) {
|
||||
channel->exit_status = -1;
|
||||
channel->flags = SSH_CHANNEL_FLAG_NOT_BOUND;
|
||||
|
||||
if(session->channels == NULL) {
|
||||
if (session->channels == NULL) {
|
||||
session->channels = ssh_list_new();
|
||||
}
|
||||
|
||||
ssh_list_prepend(session->channels, channel);
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user