diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 4a050473..d8b9296a 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -144,10 +144,10 @@ set(MAN_PAGES libssh2_session_init_ex.3 libssh2_session_last_errno.3 libssh2_session_last_error.3 - libssh2_session_set_last_error.3 libssh2_session_method_pref.3 libssh2_session_methods.3 libssh2_session_set_blocking.3 + libssh2_session_set_last_error.3 libssh2_session_set_timeout.3 libssh2_session_startup.3 libssh2_session_supported_algs.3 diff --git a/docs/Makefile.am b/docs/Makefile.am index 6b938ba7..cc0e5244 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -114,10 +114,10 @@ dist_man_MANS = \ libssh2_session_init_ex.3 \ libssh2_session_last_errno.3 \ libssh2_session_last_error.3 \ - libssh2_session_set_last_error.3 \ libssh2_session_method_pref.3 \ libssh2_session_methods.3 \ libssh2_session_set_blocking.3 \ + libssh2_session_set_last_error.3 \ libssh2_session_set_timeout.3 \ libssh2_session_startup.3 \ libssh2_session_supported_algs.3 \ diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index c20d37ce..1badba3e 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -41,26 +41,26 @@ add_definitions(-DHAVE_CONFIG_H) set(EXAMPLES direct_tcpip - ssh2 scp scp_nonblock scp_write scp_write_nonblock sftp + sftp_RW_nonblock + sftp_append + sftp_mkdir + sftp_mkdir_nonblock sftp_nonblock sftp_write sftp_write_nonblock - sftp_mkdir - sftp_mkdir_nonblock - sftp_RW_nonblock sftp_write_sliding sftpdir sftpdir_nonblock - ssh2_exec + ssh2 ssh2_agent ssh2_agent_forwarding ssh2_echo - sftp_append + ssh2_exec subsystem_netconf tcpip-forward) @@ -71,6 +71,7 @@ foreach(example ${EXAMPLES}) target_include_directories(example-${example} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src) target_link_libraries(example-${example} ${LIB_STATIC} ${LIBRARIES}) endforeach() + add_target_to_copy_dependencies( TARGET copy_example_dependencies DEPENDENCIES ${RUNTIME_DEPENDENCIES} diff --git a/example/x11.c b/example/x11.c index e66da688..80d4f465 100644 --- a/example/x11.c +++ b/example/x11.c @@ -1,8 +1,7 @@ /* - * * Sample showing how to makes SSH2 with X11 Forwarding works. * - * Usage : + * Usage: * "ssh2 host user password [DEBUG]" */ diff --git a/src/channel.h b/src/channel.h index dc0ee376..4466c4fc 100644 --- a/src/channel.h +++ b/src/channel.h @@ -138,4 +138,3 @@ int _libssh2_channel_close(LIBSSH2_CHANNEL * channel); int _libssh2_channel_forward_cancel(LIBSSH2_LISTENER *listener); #endif /* __LIBSSH2_CHANNEL_H */ - diff --git a/src/libssh2.pc.in b/src/libssh2.pc.in index c070988b..282a39b5 100644 --- a/src/libssh2.pc.in +++ b/src/libssh2.pc.in @@ -14,4 +14,4 @@ Version: @LIBSSH2_VERSION@ Requires.private: @PC_REQUIRES_PRIVATE@ Libs: -L${libdir} -lssh2 @PC_LIBS@ Libs.private: @PC_LIBS@ -Cflags: -I${includedir} \ No newline at end of file +Cflags: -I${includedir} diff --git a/src/libssh2_config_cmake.h.in b/src/libssh2_config_cmake.h.in index 712e869d..8ee6389b 100644 --- a/src/libssh2_config_cmake.h.in +++ b/src/libssh2_config_cmake.h.in @@ -61,8 +61,6 @@ /* Functions */ #cmakedefine HAVE_GETTIMEOFDAY -#cmakedefine HAVE_POLL -#cmakedefine HAVE_SELECT #cmakedefine HAVE_STRTOLL #cmakedefine HAVE_STRTOI64 #cmakedefine HAVE_SNPRINTF @@ -70,6 +68,9 @@ #cmakedefine HAVE_EXPLICIT_MEMSET #cmakedefine HAVE_MEMSET_S +#cmakedefine HAVE_POLL +#cmakedefine HAVE_SELECT + /* Socket non-blocking support */ #cmakedefine HAVE_O_NONBLOCK #cmakedefine HAVE_FIONBIO diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h index 3e02cf18..adb0dca9 100644 --- a/src/libssh2_priv.h +++ b/src/libssh2_priv.h @@ -76,7 +76,7 @@ # define LIBSSH2_WINDOWS_APP # endif # endif -#endif +#endif /* WIN32 */ #ifdef HAVE_WS2TCPIP_H #include diff --git a/src/packet.c b/src/packet.c index 43b92f7b..f507770a 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1406,4 +1406,3 @@ _libssh2_packet_requirev(LIBSSH2_SESSION *session, state->start = 0; return LIBSSH2_ERROR_SOCKET_DISCONNECT; } - diff --git a/src/session.c b/src/session.c index 817bc179..65946e1e 100644 --- a/src/session.c +++ b/src/session.c @@ -1740,7 +1740,7 @@ libssh2_poll(LIBSSH2_POLLFD * fds, unsigned int nfds, long timeout) */ sysret = poll(sockets, nfds, (int)timeout_remaining); timeout_remaining = 0; -#endif /* HAVE_GETTIMEOFDAY */ +#endif /* HAVE_LIBSSH2_GETTIMEOFDAY */ if(sysret > 0) { for(i = 0; i < nfds; i++) { diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 7bf0ad35..2c91eaef 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -68,9 +68,9 @@ endif DB ?= NDEBUG CPPFLAGS += -D$(DB) ifeq ($(DB),NDEBUG) - OBJDIR := release + OBJ_DIR := release else - OBJDIR := debug + OBJ_DIR := debug CFLAGS += -g CPPFLAGS += -DLIBSSH2DEBUG endif @@ -143,7 +143,7 @@ AWK := awk ZIP := zip -qzr9 # Include the version info retrieved from libssh2.h --include $(OBJDIR)/version.inc +-include $(OBJ_DIR)/version.inc vpath %.c $(PROOT)/src @@ -151,7 +151,7 @@ vpath %.c $(PROOT)/src include $(PROOT)/Makefile.inc OBJECTS := $(patsubst %.c,%.o,$(CSOURCES)) -OBJS := $(addprefix $(OBJDIR)/,$(OBJECTS)) +OBJS := $(addprefix $(OBJ_DIR)/,$(OBJECTS)) TARGET := libssh2 @@ -172,29 +172,29 @@ dll: prebuild $(libssh2_dll_LIBRARY) lib: prebuild $(TARGET).a -prebuild: $(OBJDIR) $(OBJDIR)/version.inc +prebuild: $(OBJ_DIR) $(OBJ_DIR)/version.inc test: $(TARGETS_EXAMPLES) %.exe: %.c $(libssh2_DEPENDENCIES) $(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBSSH2_LDFLAGS_BIN) $< -o $@ $(LIBS) $(LIBS_BIN) -$(OBJDIR)/%.o: %.c +$(OBJ_DIR)/%.o: %.c $(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) -c $< -o $@ -$(libssh2_dll_LIBRARY) $(libssh2_dll_a_LIBRARY): $(OBJS) $(OBJDIR)/$(TARGET).res +$(libssh2_dll_LIBRARY) $(libssh2_dll_a_LIBRARY): $(OBJS) $(OBJ_DIR)/$(TARGET).res @$(call DEL, $@) $(CC) $(LDFLAGS) -shared $(LIBSSH2_LDFLAGS_LIB) $^ -o $@ $(LIBS) $(LIBS_LIB) \ -Wl,--output-def,$(libssh2_dll_LIBRARY:.dll=.def),--out-implib,$(libssh2_dll_a_LIBRARY) -$(OBJDIR)/%.res: %.rc +$(OBJ_DIR)/%.res: %.rc $(RC) -O coff $(RCFLAGS) -i $< -o $@ $(TARGET).a: $(OBJS) @$(call DEL, $@) $(AR) rcs $@ $^ -$(OBJDIR)/version.inc: $(PROOT)/get_ver.awk $(PROOT)/include/libssh2.h $(OBJDIR) +$(OBJ_DIR)/version.inc: $(PROOT)/get_ver.awk $(PROOT)/include/libssh2.h $(OBJ_DIR) $(AWK) -f $^ > $@ dist: all $(DISTDIR) $(DISTDIR)/readme.txt @@ -216,16 +216,16 @@ distclean vclean: clean $(call DEL, $(DISTARC)) objclean: all - $(call RMDIR, $(OBJDIR)) + $(call RMDIR, $(OBJ_DIR)) testclean: clean $(call DEL, $(TARGETS_EXAMPLES)) clean: $(call DEL, $(libssh2_dll_LIBRARY) $(libssh2_dll_LIBRARY:.dll=.def) $(TARGET).a $(libssh2_dll_a_LIBRARY)) - $(call RMDIR, $(OBJDIR)) + $(call RMDIR, $(OBJ_DIR)) -$(OBJDIR): +$(OBJ_DIR): @$(call MKDIR, $@) $(DISTDIR): @@ -239,7 +239,7 @@ $(DISTDIR)/readme.txt: GNUmakefile @echo $(DL)any further documentation:$(DL) >> $@ @echo $(DL)$(HOMEPAGE)$(DL) >> $@ -help: $(OBJDIR)/version.inc +help: $(OBJ_DIR)/version.inc @echo $(DL)===========================================================$(DL) @echo $(DL)OpenSSL path = $(OPENSSL_PATH)$(DL) @echo $(DL)wolfSSL path = $(WOLFSSL_PATH)$(DL)