From f2cf59b47f379257de7822670b54702826884980 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 14 Apr 2019 13:11:06 +0200 Subject: some debugging and fixing of the SCP mode --- CMakeLists.txt | 3 ++- README | 2 +- src/cssh.c | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e5786..d22d11f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,8 @@ project(cssh C) set( CSSH_VERSION 0.0.1 ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -D_XOPEN_SOURCE=700") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -std=c99 -Wall -D_XOPEN_SOURCE=700") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0 -std=c99 -Wall -D_XOPEN_SOURCE=700") set( libssh_FIND_REQUIRED TRUE) find_libssh( ) diff --git a/README b/README index ec92ac5..fe66791 100644 --- a/README +++ b/README @@ -61,7 +61,7 @@ had an effect on my project: [6] https://github.com/badoo/libpssh Libary for multiple SSH connections using libevent and libssh2. - A little bit to complicated for my taste, I prefer direct asynchronous + A little bit too complicated for my taste, I prefer direct asynchronous I/O without an abstraction library like libevent. Also I prefer to use libssh unpatched. diff --git a/src/cssh.c b/src/cssh.c index ae81df8..c45f310 100644 --- a/src/cssh.c +++ b/src/cssh.c @@ -1252,10 +1252,12 @@ SHELL_EOF: rc = mkdir( full_path, 0750 ); if( rc < 0 ) { - fprintf( stderr, "ERROR: failed to create base directory '%s' for host '%s': %s\n", - full_path, host[i], strerror( errno ) ); - cleanup_sessions( &session, NULL, &scp_data, host, port, nof_sessions, args_info.verbose_given > 0 ); - exit( EXIT_FAILURE ); + if( errno != EEXIST ) { + fprintf( stderr, "ERROR: failed to create base directory '%s' for host '%s': %s\n", + full_path, host[i], strerror( errno ) ); + cleanup_sessions( &session, NULL, &scp_data, host, port, nof_sessions, args_info.verbose_given > 0 ); + exit( EXIT_FAILURE ); + } } } else { scp_data[i].filename = pwd; -- cgit v1.2.3-54-g00ecf