]> git.wh0rd.org - dump.git/commitdiff
Added a configure check for sa_sigaction member of struct sigaction.
authorStelian Pop <stelian@popies.net>
Mon, 21 Aug 2000 10:45:39 +0000 (10:45 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 21 Aug 2000 10:45:39 +0000 (10:45 +0000)
Modified bylabel to be self contained (it doesn't depend any more on
kernel/libc header files which could be out of date).

CHANGES
THANKS
compat/lib/bylabel.c
config.h.in
configure
configure.in
dump/tape.c

diff --git a/CHANGES b/CHANGES
index 86da4aab5a54acb18c0642ce2a1c3fd35c7327f5..0845ca5ee3480e418e9da935cea1bfe1e847cb73 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,19 @@
-$Id: CHANGES,v 1.78 2000/08/20 19:45:38 stelian Exp $
+$Id: CHANGES,v 1.79 2000/08/21 10:45:39 stelian Exp $
+
+Changes between versions 0.4b19 and 0.4b20 (released ???????????????)
+=====================================================================
+
+1.     Added a configure option to search for sa_sigaction member
+       of the struct sigaction. This should fix the compile on
+       libc5. Thanks to Gunther Schlegel <schlegel@riege.de>
+        for reporting the bug.
+
+2.     Modified the label and uuid analysis in order to be 
+       self-contained (independant of kernel/libc headers). This 
+        should fix the compile with older kernel/libc headers and
+       will preserve the functionality. Thanks to Bernhard Erdmann
+       <bernhard.erdmann@gmx.de> for reporting the bug.
+
 
 Changes between versions 0.4b18 and 0.4b19 (released August 20, 2000)
 =====================================================================
@@ -32,6 +47,7 @@ Changes between versions 0.4b18 and 0.4b19 (released August 20, 2000)
 
 7.     Updated the RPM spec file to the latest RedHat version,
        providing FHS packaging and other cosmetic changes.
+       You will need RPM version >= 3.0.5 in order to build the RPM.
 
 8.     Updated the configure script to check for libtermcap
        before checking for libreadline, because we need this
diff --git a/THANKS b/THANKS
index be951b8ca92ac5c57a5b3d8a4b8a87b8792bc46d..6bea6192f2d0ec67f8b6ff043ae2bf20423ea946 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.34 2000/08/20 19:53:49 stelian Exp $
+$Id: THANKS,v 1.35 2000/08/21 10:45:39 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -58,6 +58,7 @@ Kenneth Porter                shiva@well.com
 Bernhard Sadlowski     sadlowsk@Mathematik.Uni-Bielefeld.DE
 Jan Sanislo            oystr@cs.washington.edu
 Patrik Schindler       poc@pocnet.net
+Gunther Schlegel       schlegel@riege.de
 Chris Siebenmann       cks@utcc.utoronto.ca
 Bob Snyder             rsnyder@janet.advsys.com
 Matti Taskinen         mkt@rni.helsinki.fi
index 9cdd0e5da502524644ee1fe4fba7a9bb50a4a364..c91457d3d232d7b47ff0209dc2a7c0531c79d4c6 100644 (file)
 #include <ctype.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <linux/ext2_fs.h>
-#include <ext2fs/ext2fs.h>
+#include <malloc.h>
 #include "bylabel.h"
 
 #define PROC_PARTITIONS "/proc/partitions"
 #define DEVLABELDIR    "/dev"
 
+#define EXT2_SUPER_MAGIC 0xEF53
+struct ext2_super_block {
+       unsigned char   s_dummy1[56];
+       unsigned char   s_magic[2];
+       unsigned char   s_dummy2[46];
+       unsigned char   s_uuid[16];
+       unsigned char   s_volume_name[16];
+};
+#define ext2magic(s)   ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8))
+
 void msg __P((const char *fmt, ...));
 
 static struct uuidCache_s {
@@ -48,7 +57,7 @@ get_label_uuid(const char *device, char **label, char *uuid) {
 
        if (lseek(fd, 1024, SEEK_SET) != 1024
            || read(fd, (char *) &e2sb, sizeof(e2sb)) != sizeof(e2sb)
-           || (e2sb.s_magic != EXT2_SUPER_MAGIC)) {
+           || (ext2magic(e2sb) != EXT2_SUPER_MAGIC)) {
                close(fd);
                return 1;
        }
@@ -67,10 +76,10 @@ uuidcache_addentry(char *device, char *label, char *uuid) {
        struct uuidCache_s *last;
 
        if (!uuidCache) {
-               last = uuidCache = malloc(sizeof(*uuidCache));
+               last = uuidCache = (struct uuidCache_s *)malloc(sizeof(*uuidCache));
        } else {
                for (last = uuidCache; last->next; last = last->next) ;
-               last->next = malloc(sizeof(*uuidCache));
+               last->next = (struct uuidCache_s *)malloc(sizeof(*uuidCache));
                last = last->next;
        }
        last->next = NULL;
index 1f51bea1b79c3d0f6437eb6236387d6fad20ff9b..9c674449708f7b41911bdbb7141b9b21403c47a5 100644 (file)
@@ -47,3 +47,6 @@
 
 /* Define this is you want old style F script (no arguments) */
 #undef OLD_STYLE_FSCRIPT
+
+/* Define if you have the sa_sigaction field in struct sigaction */
+#undef HAVE_SIGACTION_SA_SIGACTION
index 44fa7a17408c25812bd423c97fb3ec0b6574989b..8b2bedd628aedfb7552565a39e7dc055588196f6 100755 (executable)
--- a/configure
+++ b/configure
@@ -1939,13 +1939,47 @@ rm -f conftest*
        fi
 fi
 
+echo $ac_n "checking whether struct sigaction has a sa_sigaction field""... $ac_c" 1>&6
+echo "configure:1944: checking whether struct sigaction has a sa_sigaction field" >&5
+if eval "test \"`echo '$''{'dump_cv_struct_sa_sigaction'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1949 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <signal.h>
+int main() {
+struct sigaction action; action.sa_sigaction = NULL;
+; return 0; }
+EOF
+if { (eval echo configure:1957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  dump_cv_struct_sa_sigaction=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  dump_cv_struct_sa_sigaction=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$dump_cv_struct_sa_sigaction" 1>&6
+if test "$dump_cv_struct_sa_sigaction" = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_SIGACTION_SA_SIGACTION 1
+EOF
+
+fi
+
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1944: checking for ANSI C header files" >&5
+echo "configure:1978: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1949 "configure"
+#line 1983 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1953,7 +1987,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1970,7 +2004,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 2008 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1988,7 +2022,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1992 "configure"
+#line 2026 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2009,7 +2043,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2013 "configure"
+#line 2047 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2020,7 +2054,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2044,12 +2078,12 @@ EOF
 fi
 
 echo $ac_n "checking for quad_t""... $ac_c" 1>&6
-echo "configure:2048: checking for quad_t" >&5
+echo "configure:2082: checking for quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2053 "configure"
+#line 2087 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2077,12 +2111,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6
-echo "configure:2081: checking for u_quad_t" >&5
+echo "configure:2115: checking for u_quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2086 "configure"
+#line 2120 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
index dcb6bfb7296c4de2062594f5add1bd55bc82f677..802f31a560cad4e276078aac381179f0ff171812 100644 (file)
@@ -303,6 +303,22 @@ if test "$ac_cv_func_glob" = "yes"; then
        fi
 fi
 
+dnl
+dnl Check if sigaction structure has a sa_sigaction field
+dnl
+AC_MSG_CHECKING(whether struct sigaction has a sa_sigaction field)
+AC_CACHE_VAL(dump_cv_struct_sa_sigaction,
+AC_TRY_COMPILE(
+[#include <stdio.h>
+#include <signal.h>],
+[struct sigaction action; action.sa_sigaction = NULL;],
+[dump_cv_struct_sa_sigaction=yes],
+[dump_cv_struct_sa_sigaction=no]))
+AC_MSG_RESULT($dump_cv_struct_sa_sigaction)
+if test "$dump_cv_struct_sa_sigaction" = yes; then
+  AC_DEFINE(HAVE_SIGACTION_SA_SIGACTION)
+fi
+
 dnl
 dnl Check for types
 dnl
index 851a5cdc5204375bac819394cfd9f894fbe7014b..91474418c3bef907d6acd6c0df6ecb5442bb8836 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.21 2000/08/19 22:06:03 stelian Exp $";
+       "$Id: tape.c,v 1.22 2000/08/21 10:45:40 stelian Exp $";
 #endif /* not lint */
 
 #ifdef __linux__
@@ -895,7 +895,9 @@ enslave(void)
        master = getpid();
 
     {  struct sigaction sa;
+#if    HAVE_SIGACTION_SA_SIGACTION
        sa.sa_sigaction = NULL;
+#endif
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = 0;
        sa.sa_handler = dumpabort;