- (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.
diff --git a/ChangeLog b/ChangeLog
index df6fba7..85446e3 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 80db43a..0447bd6 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 @@
]
)
-AC_CHECK_DECL(DTTOIF,
- AC_DEFINE(DTTOIF_IN_FS_FFS_DIR_H, 1 , [DTTOIF macro in fs/ffs/dir.h]), ,
- [
-#include <sys/types.h>
-#include <fs/ffs/dir.h>
- ])
-
-AC_CHECK_MEMBERS([struct dirent.d_type],,, [#include <dirent.h>])
-
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 a9c895a..cc4a5b1 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -37,9 +37,6 @@
#include <sys/uio.h>
#include <dirent.h>
-#ifdef DTTOIF_IN_FS_FFS_DIR_H
-# include <fs/ffs/dir.h>
-#endif
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
@@ -1454,20 +1451,6 @@
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 @@
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 @@
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);