/* Define if OpenSSL library is available */
#undef HAVE_OPENSSL
+/* Define to 1 if you have the `posix_fadvise' function. */
+#undef HAVE_POSIX_FADVISE
+
/* Define if your printf() function supports format strings with positions. */
#undef HAVE_POSIX_PRINTF
/* 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 runtime.
- 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. */
AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
+AC_CHECK_FUNCS(posix_fadvise)
AC_CHECK_FUNCS(chflags)
done
+for ac_func in posix_fadvise
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 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'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
for ac_func in chflags
do
int fatal = 0;
time_t begin_time = time(NULL);
time_t now;
+ btimer_t *tid = NULL;
+ /* Try to trap out of OS call when time expires */
+ tid = start_thread_timer(pthread_self(), (uint32_t)max_retry_time);
+
for (i = 0; (bsock = bnet_open(jcr, name, host, service, port, heart_beat, &fatal)) == NULL;
i -= retry_interval) {
berrno be;
if (fatal || (jcr && job_canceled(jcr))) {
- return NULL;
+ bsock = NULL;
+ goto bail_out;
}
Dmsg4(100, "Unable to connect to %s on %s:%d. ERR=%s\n",
name, host, port, be.strerror());
if (begin_time + max_retry_time <= now) {
Qmsg4(jcr, M_FATAL, 0, _("Unable to connect to %s on %s:%d. ERR=%s\n"),
name, host, port, be.strerror());
- return NULL;
+ bsock = NULL;
+ goto bail_out;
}
}
+
+bail_out;
+ if (tid) {
+ stop_thread_timer(tid);
+ }
return bsock;
}
bs->msg = realloc_pool_memory(bs->msg, maxlen + maxlen / 2);
}
return bs->send();
-// return bnet_send(bs);
}
-int bnet_get_peer(BSOCK *bs, char *buf, socklen_t buflen) {
+int bnet_get_peer(BSOCK *bs, char *buf, socklen_t buflen)
+{
#if !defined(HAVE_WIN32)
if (bs->peer_addr.sin_family == 0) {
socklen_t salen = sizeof(bs->peer_addr);
int count = 0;
rewind(spool_fd);
+
+#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
+ posix_fadvise(fileno(spool_fd), 0, 0, POSIX_FADV_WILLNEED);
+#endif
+
while (fread((char *)&pktsiz, 1, sizeof(int32_t), spool_fd) ==
sizeof(int32_t)) {
size += sizeof(int32_t);
}
fileWidget->clear();
fileWidget->insertTopLevelItems(0, items);
+ for (int i=0; i<7; i++) {
+ fileWidget->resizeColumnToContents(i);
+ }
free_pool_memory(file);
free_pool_memory(path);
# RemovableMedia = yes;
# RandomAccess = no;
# AutoChanger = yes
+# #
# # Enable the Alert command only if you have the mtx package loaded
+# # Note, apparently on some systems, tapeinfo resets the SCSI controller
+# # thus if you turn this on, make sure it does not reset your SCSI
+# # controller. I have never had any problems, and smartctl does
+# # not seem to cause such problems.
+# #
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
Dmsg1(800, "read/write block size = %d\n", block->buf_len);
lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
+#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
+ posix_fadvise(rdcr->spool_fd, 0, 0, POSIX_FADV_WILLNEED);
+#endif
+
/* Add run time, to get current wait time */
time_t despool_start = time(NULL) - jcr->run_time;
Technical notes on version 2.1
General:
+23Apr07
+kes Implement posix_fadvise in FD, and for reading spool files in SD.
+kes Add thread timer to bnet_connect() to break from OS if wait time
+ expires.
22Apr07
kes Update Win32 build to include new files, new symbols, and
renamed files.