very expensive. */
#undef CACHE_IDS
+/* Define if you have the <sys/statvfs.h> header file */
+#undef HAVE_SYS_STATVFS_H
+
/* Define to use SVR4 statvfs to get filesystem type. */
#undef FSTYPE_STATVFS
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
fi
AC_MSG_RESULT($fstype)
+AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
+
dnl# --------------------------------------------------------------------------
dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
dnl# --------------------------------------------------------------------------
echo "$as_me:$LINENO: result: $fstype" >&5
echo "${ECHO_T}$fstype" >&6
+if test "${ac_cv_header_sys_statvfs_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sys/statvfs.h" >&5
+echo $ECHO_N "checking for sys/statvfs.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_statvfs_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_statvfs_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_statvfs_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/statvfs.h usability" >&5
+echo $ECHO_N "checking sys/statvfs.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sys/statvfs.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/statvfs.h presence" >&5
+echo $ECHO_N "checking sys/statvfs.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/statvfs.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/statvfs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/statvfs.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/statvfs.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/statvfs.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/statvfs.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/statvfs.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/statvfs.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/statvfs.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/statvfs.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for sys/statvfs.h" >&5
+echo $ECHO_N "checking for sys/statvfs.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_statvfs_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sys_statvfs_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_statvfs_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_statvfs_h" >&6
+
+fi
+if test $ac_cv_header_sys_statvfs_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_STATVFS_H 1
+_ACEOF
+
+fi
+
+
+
echo "$as_me:$LINENO: checking return type of signal handlers" >&5
echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
if test "${ac_cv_type_signal+set}" = set; then
General:
Changes to 1.37.41:
+14Oct05
+- Add NetBSD fstype patch from Geert Hendrickx <ghen@telenet.be>
+- Update num_parts only when writing to DVD.
13Oct05
- Fix error conditions in bpipe.c DVD routine (terminate buffer).
- Use a bigger buffer 32K as suggested by Arno in bpipe.c.
"HAVE_NETBSD_OS\n" \
"HAVE_OPENBSD_OS\n" \
"HAVE_SUN_OS\n"
-#define bool int
-#define false 0
-#define true 1
-#define bstrncpy strncpy
-#define Dmsg0(n,s) fprintf(stderr, s)
-#define Dmsg1(n,s,a1) fprintf(stderr, s, a1)
+#define bool int
+#define false 0
+#define true 1
+#define bstrncpy strncpy
+#define Dmsg0(n,s) fprintf(stderr, s)
+#define Dmsg1(n,s,a1) fprintf(stderr, s, a1)
#define Dmsg2(n,s,a1,a2) fprintf(stderr, s, a1, a2)
#endif
/*
* These functions should be implemented for each OS
*
- * bool fstype(const char *fname, char *fs, int fslen);
+ * bool fstype(const char *fname, char *fs, int fslen);
*/
#if defined(HAVE_DARWIN_OS) \
|| defined(HAVE_FREEBSD_OS ) \
#elif defined(HAVE_NETBSD_OS)
#include <sys/param.h>
#include <sys/mount.h>
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#else
+#define statvfs statfs
+#endif
bool fstype(const char *fname, char *fs, int fslen)
{
/* Known good values */
case 0xef53: bstrncpy(fs, "ext2", fslen); return true; /* EXT2_SUPER_MAGIC */
- /* case 0xef53: ext2 and ext3 are the same */ /* EXT3_SUPER_MAGIC */
+ /* case 0xef53: ext2 and ext3 are the same */ /* EXT3_SUPER_MAGIC */
case 0x3153464a: bstrncpy(fs, "jfs", fslen); return true; /* JFS_SUPER_MAGIC */
case 0x5346544e: bstrncpy(fs, "ntfs", fslen); return true; /* NTFS_SB_MAGIC */
case 0x9fa0: bstrncpy(fs, "proc", fslen); return true; /* PROC_SUPER_MAGIC */
case 0x517B: bstrncpy(fs, "smbfs", fslen); return true; /* SMB_SUPER_MAGIC */
case 0x9660: bstrncpy(fs, "iso9660", fslen); return true; /* ISOFS_SUPER_MAGIC */
-#if 0 /* These need confirmation */
+#if 0 /* These need confirmation */
case 0xadf5: bstrncpy(fs, "adfs", fslen); return true; /* ADFS_SUPER_MAGIC */
case 0xadff: bstrncpy(fs, "affs", fslen); return true; /* AFFS_SUPER_MAGIC */
case 0x6B414653: bstrncpy(fs, "afs", fslen); return true; /* AFS_FS_MAGIC */
default:
Dmsg2(10, "Unknown file system type \"0x%x\" for \"%s\".\n", st.f_type,
- fname);
- return false;
+ fname);
+ return false;
}
}
Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
}
/* Tru64 */
-#else /* No recognised OS */
+#else /* No recognised OS */
bool fstype(const char *fname, char *fs, int fslen)
{
Dmsg0(10, "!!! fstype() not implemented for this OS. !!!\n");
#ifdef TEST_PROGRAM
Dmsg1(10, "Please define one of the following when compiling:\n\n%s\n",
- SUPPORTEDOSES);
+ SUPPORTEDOSES);
exit(EXIT_FAILURE);
#endif
p = (argc < 1) ? "fstype" : argv[0];
printf("usage:\t%s path ...\n"
"\t%s prints the file system type and pathname of the paths.\n",
- p, p);
+ p, p);
return EXIT_FAILURE;
}
while (*++argv) {
if (!fstype(*argv, fs, sizeof(fs))) {
- status = EXIT_FAILURE;
+ status = EXIT_FAILURE;
} else {
printf("%s\t%s\n", fs, *argv);
}
dcr->block->write_failed = true;
if (weof_dev(dev, 1) != 0) { /* end the tape */
dev->VolCatInfo.VolCatErrors++;
- Jmsg(dcr->jcr, M_ERROR, 0, _("Error writing final EOF to tape. This tape may not be readable.\n"
+ Jmsg(dcr->jcr, M_ERROR, 0, _("Error writing final EOF to tape. This Volume may not be readable.\n"
"%s"), dev->errmsg);
ok = false;
Dmsg0(100, "WEOF error.\n");
{
DEVICE *dev = dcr->dev;
POOL_MEM ocmd(PM_FNAME);
+ POOL_MEM results(PM_MESSAGE);
+ POOL_MEM archive_name(PM_FNAME);
char* icmd;
int status;
int timeout;
Dmsg2(29, "dvd_write_part: cmd=%s timeout=%d\n", ocmd.c_str(), timeout);
- {
- POOL_MEM results(PM_MESSAGE);
- sm_check(__FILE__, __LINE__, false);
- status = run_program_full_output(ocmd.c_str(), timeout, results.c_str());
- sm_check(__FILE__, __LINE__, false);
- if (status != 0) {
- Mmsg1(dev->errmsg, _("Error while writing current part to the DVD: %s"),
- results.c_str());
- Dmsg1(000, "%s", dev->errmsg);
- dev->dev_errno = EIO;
- mark_volume_in_error(dcr);
- return false;
- }
+ status = run_program_full_output(ocmd.c_str(), timeout, results.c_str());
+ if (status != 0) {
+ Mmsg1(dev->errmsg, _("Error while writing current part to the DVD: %s"),
+ results.c_str());
+ Dmsg1(000, "%s", dev->errmsg);
+ dev->dev_errno = EIO;
+ mark_volume_in_error(dcr);
sm_check(__FILE__, __LINE__, false);
+ return false;
+ } else {
+ dev->num_parts++; /* there is no one more part on DVD */
}
- {
- POOL_MEM archive_name(PM_FNAME);
- /* Delete spool file */
- make_spooled_dvd_filename(dev, archive_name);
- unlink(archive_name.c_str());
- Dmsg1(29, "unlink(%s)\n", archive_name.c_str());
- sm_check(__FILE__, __LINE__, false);
- }
+ /* Delete spool file */
+ make_spooled_dvd_filename(dev, archive_name);
+ unlink(archive_name.c_str());
+ Dmsg1(29, "unlink(%s)\n", archive_name.c_str());
+ sm_check(__FILE__, __LINE__, false);
/* growisofs umounted the device, so remount it (it will update the free space) */
dev->clear_mounted();
*/
if (dev->is_dvd() && (dev->part >= dev->num_parts) && dev->can_append()) {
if (!dvd_write_part(dcr)) {
+ Dmsg0(29, "Error in dvd_write part.\n");
return -1;
}
}
}
}
- Dmsg2(100, "Set npart=%d to part=%d\n", dev->num_parts, dev->part);
- dev->num_parts = dev->part;
+ Dmsg2(100, "num_parts=%d part=%d\n", dev->num_parts, dev->part);
dev->VolCatInfo.VolCatParts = dev->part;
make_spooled_dvd_filename(dev, archive_name); /* makes spool name */
}
}
}
+ /* KES. It seems to me that this if should not be
+ * needed. If num_parts represents what is on the DVD
+ * we should only need to change it when writing a part
+ * to the DVD.
+ */
if (dev->num_parts < dev->part) {
Dmsg2(100, "Set npart=%d to part=%d\n", dev->num_parts, dev->part);
dev->num_parts = dev->part;
#undef VERSION
#define VERSION "1.37.41"
-#define BDATE "13 October 2005"
-#define LSMDATE "13Oct05"
+#define BDATE "14 October 2005"
+#define LSMDATE "14Oct05"
/* Debug flags */
#undef DEBUG