summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2001-08-27 12:18:16 -0400
committerTheodore Ts'o <tytso@mit.edu>2001-08-27 12:18:16 -0400
commit53abed0afafec661fd923cb9cd9f0eee891ccbde (patch)
tree2d3f8fce3644e8da0e61ab79a1cb839774beb3a6
parentb1c9a000712b53e23b35e212950d92a5ec26b2f9 (diff)
downloade2fsprogs-53abed0afafec661fd923cb9cd9f0eee891ccbde.tar.gz
Deal with libc5's lack of strnlen.
Stop checking for strdup in the configure script since we don't care about that symbol.
-rw-r--r--ChangeLog6
-rw-r--r--configure2
-rw-r--r--configure.in2
-rw-r--r--e2fsck/ChangeLog4
-rw-r--r--e2fsck/pass1.c17
5 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b36eb255..38785bb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-08-27 Theodore Tso <tytso@valinux.com>
+
+ * configure.in: Check for the presence of strnlen. Stop checking
+ for strdup, since we don't actually care about that symbol
+ any more.
+
2001-08-04 Andreas Dilger <root@lynx.adilger.int>
* Makefile.in: Add "*.orig" to "make clean" target, change
diff --git a/configure b/configure
index 3675cf2a..8bfaaae9 100644
--- a/configure
+++ b/configure
@@ -4620,7 +4620,7 @@ EOF
fi
fi
-for ac_func in chflags getrusage llseek lseek64 open64 strdup getmntinfo strcasecmp srandom fchown mallinfo fdatasync
+for ac_func in chflags getrusage llseek lseek64 open64 getmntinfo strcasecmp srandom fchown mallinfo fdatasync strnlen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4627: checking for $ac_func" >&5
diff --git a/configure.in b/configure.in
index 2b8158c8..a9ad429f 100644
--- a/configure.in
+++ b/configure.in
@@ -541,7 +541,7 @@ if test "$e2fsprogs_cv_struct_st_flags" = yes; then
AC_DEFINE(HAVE_STAT_FLAGS)
fi
fi
-AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 strdup getmntinfo strcasecmp srandom fchown mallinfo fdatasync)
+AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strcasecmp srandom fchown mallinfo fdatasync strnlen)
dnl
dnl Check to see if -lsocket is required (solaris) to make something
dnl that uses socket() to compile; this is needed for the UUID library
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index 93648c42..e9ec9824 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,3 +1,7 @@
+2001-08-27 Theodore Tso <tytso@valinux.com>
+
+ * pass1.c (strnlen): Provide strnlen if libc doesn't.
+
2001-08-13 Theodore Tso <tytso@valinux.com>
* super.c (release_orphan_inodes): If the filesystem contains
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 2792df76..085999ac 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -131,7 +131,7 @@ int e2fsck_pass1_check_device_inode(struct ext2_inode *inode)
* If i_blocks is non-zero, then this is a bogus device/fifo/socket
*/
if (inode->i_blocks)
- return 1;
+ return 0;
/*
* We should be able to do the test below all the time, but
* because the kernel doesn't forcibly clear the device
@@ -151,6 +151,21 @@ int e2fsck_pass1_check_device_inode(struct ext2_inode *inode)
return 1;
}
+#ifndef HAVE_STRNLEN
+/*
+ * Incredibly, libc5 doesn't appear to have strncpy. So we have to
+ * provide our own.
+ */
+static int strnlen(const char * s, int count)
+{
+ const char *cp = s;
+
+ while (count-- && *cp)
+ cp++;
+ return cp - s;
+}
+#endif
+
/*
* Check to make sure a symlink inode is real. Returns 1 if the symlink
* checks out, 0 if not.