mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
examples: Zero fds in sshnetcat
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -14,6 +14,10 @@ clients must be made or how a client should react.
|
|||||||
#define EXAMPLES_COMMON_H_
|
#define EXAMPLES_COMMON_H_
|
||||||
|
|
||||||
#include <libssh/libssh.h>
|
#include <libssh/libssh.h>
|
||||||
|
|
||||||
|
/** Zero a structure */
|
||||||
|
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
|
||||||
|
|
||||||
int authenticate_console(ssh_session session);
|
int authenticate_console(ssh_session session);
|
||||||
int authenticate_kbdint(ssh_session session, const char *password);
|
int authenticate_kbdint(ssh_session session, const char *password);
|
||||||
int verify_knownhost(ssh_session session);
|
int verify_knownhost(ssh_session session);
|
||||||
|
@ -90,6 +90,7 @@ static void select_loop(ssh_session session,ssh_channel channel){
|
|||||||
do{
|
do{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
ZERO_STRUCT(fds);
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
if(!eof)
|
if(!eof)
|
||||||
FD_SET(0,&fds);
|
FD_SET(0,&fds);
|
||||||
|
Reference in New Issue
Block a user