From c182d993762f86fbdf9e54dd5b0e3e3d229ebc13 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 11 Oct 2009 21:50:20 +1100 Subject: [PATCH] - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for dirent d_type and DTTOIF as we've switched OpenBSD to the more portable lstat. --- ChangeLog | 5 +++++ configure.ac | 13 ++----------- sftp-client.c | 21 ++------------------- 3 files changed, 9 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index df6fba7aa..85446e312 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20091011 + - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for + dirent d_type and DTTOIF as we've switched OpenBSD to the more portable + lstat. + 20091007 - (dtucker) OpenBSD CVS Sync - djm@cvs.openbsd.org 2009/08/12 00:13:00 diff --git a/configure.ac b/configure.ac index 80db43af1..0447bd62d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.429 2009/10/07 07:56:10 dtucker Exp $ +# $Id: configure.ac,v 1.430 2009/10/11 10:50:20 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.429 $) +AC_REVISION($Revision: 1.430 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -1130,15 +1130,6 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} ] ) -AC_CHECK_DECL(DTTOIF, - AC_DEFINE(DTTOIF_IN_FS_FFS_DIR_H, 1 , [DTTOIF macro in fs/ffs/dir.h]), , - [ -#include -#include - ]) - -AC_CHECK_MEMBERS([struct dirent.d_type],,, [#include ]) - AC_MSG_CHECKING([for /proc/pid/fd directory]) if test -d "/proc/$$/fd" ; then AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd]) diff --git a/sftp-client.c b/sftp-client.c index a9c895a0d..cc4a5b15b 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -37,9 +37,6 @@ #include #include -#ifdef DTTOIF_IN_FS_FFS_DIR_H -# include -#endif #include #include #include @@ -1454,20 +1451,6 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, return status; } -static mode_t -dirent_to_mode(struct dirent *dp) -{ -#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && defined(DTTOIF) - return DTTOIF(dp->d_type); -#else - struct stat sb; - - if (stat(dp->d_name, &sb) == -1) - return 0; - return sb.st_mode; -#endif -} - static int upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, int pflag, int printflag, int depth) @@ -1529,7 +1512,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, new_dst = path_append(dst, filename); new_src = path_append(src, filename); - if (S_ISDIR(dirent_to_mode(dp))) { + if (S_ISDIR(DTTOIF(dp->d_type))) { if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0) continue; @@ -1537,7 +1520,7 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst, if (upload_dir_internal(conn, new_src, new_dst, pflag, depth + 1, printflag) == -1) ret = -1; - } else if (S_ISREG(dirent_to_mode(dp))) { + } else if (S_ISREG(DTTOIF(dp->d_type)) ) { if (do_upload(conn, new_src, new_dst, pflag) == -1) { error("Uploading of file %s to %s failed!", new_src, new_dst);