-Version 1.36.1 released xxNov04:
+Changes to 1.36.3 released 23Apr05:
+22Apr05
+- Correct return type of ftello to avoid overflow --
+ thanks to Peter Eriksson.
+13Apr05
+- Fix seg fault if Name directive missing in Job resource.
+12Apr05
+- Add new LaTeX doc to 1.36.2 branch.
+- Fix SuSE autostart routines to use /etc/init.d instead
+ of /etc/rc.d/init.d.
+- Increase index size on File table Name and Path table Path
+ to improve performance.
+- Second fix for not zeroing SD pointers on restarted job.
+- Turn off old style Include/Excludes.
+01Apr05
+- Use fseeko and ftello so that attributes can exceed 4GB
+- Flush console output after every line.
+- Turn off Multiple Connections in catalog resource, which
+ causes corruped databases. It is silently ignored.
+- Drop support for old style Include/Exclude. There is a
+ perl script that will convert them.
+- Inhibit trying to reset attributes on a Win32 drive.
+18Mar05 1.36.2-store.patch
+- This patch fails a job if no Storage resource is specified and
+ the job attempts to call the SD.
+18Mar05 1.36.2-reschedule.patch
+- This patch should fix a Segfault bug when a job is rescheduled.
+ The storage pointers were being released when they should not
+ have been.
+17Mar05 1.36.2-restore-speed.patch
+- This patch will fix a subtle bug that was introduced in 1.36.2
+ which causes Bacula to be very slow restoring a few files. This
+ is because it reads completely to the end of the Volume rather
+ than stopping when all the files on the Volume are loaded. The
+ introduction of the bug was caused by a patch that fixed
+ Bacula truncating tapes after a restore.
+ Note that all source files will be rebuilt during the make.
+16Mar05 1.36.2-console.patch
+- This patch causes the output directed to a file to be
+ flushed after every line. This is a bit overkill, IMO, but
+ a user complained about it.
+15Mar05 1.36.2-netbsd.patch
+- This patch corrects a compile problem because of no statfs()
+ on NetBSD. The patch was submitted by kardel with bug 258.
+09Mar05 1.36.2-win32-drive.patch
+- This patch will prevent the Win32 FD from printing an error message
+ when it attempts to restore the permissions for a drive (which Win32
+ doesn't permit). The error is harmless in any case.
+04Mar05 1.36.2-level.patch
+- This patch should fix a problem with th %l editing in the
+ client (FD) where it edited nothing. With this fix, it should
+ edit "since".
+04Mar05 1.36.2-pool.patch
+- This patch corrects a problem preventing multiple
+ simultaneous jobs from different pools.
+
+Changes to 1.36.2 released 28Feb05:
+27Feb05
+- Fix pointer to stack variable in Verify jobs.
+- Change reference to DEV_BSIZE to B_DEV_BSIZE to
+ avoid colision with some OSes.
+- Release storage[i] in job.c if allocated when
+ starting/restarting a job. Avoids orpahanned buffers.
+24Feb05
+- Add awk check to configure.in
+- Bring over a few files from 1.37.
+18Feb05
+- Fix some lower case character problems in sql_cmds.c reported
+ by Debian.
+- Fix seg fault if debug level 900 set in SD.
+- Truncate Win32 child return code to 8 bits.
+15Feb05
+- Fix deadlock in multiple simultaneous jobs.
+- Fix tape "truncation"/"number of files" after restore bug.
+- Merge a few minor things from the 1.37 stream.
+14Feb05
+- Add a number of new features from 1.37, and apply fixes
+ for all known bugs. See ReleaseNotes for details.
+- Apply Tim's patch for ACLs.
+
+Version 1.36.1 released 26Nov04:
+24Nov04
+- Take Dan's fix to the fix_postgresql_tables (thanks Dan)
+- Increase Maximum Concurrent Jobs to 20 in SD and FD!
+- Fix improper handling of autochanger Volumes that are not
+ marked InChanger.
+22Nov04
+- Update authentication failure message to indicate possible
+ problem with Maximum Concurrent Jobs. Add to doc too.
+- Commit PostgreSQL BIGINT fix -- apparently some people didn't
+ get it.
+- Do not use a slot unless it is InChanger in the autochanger
+ code, otherwise autochanger gets upset not finding the Volume.
+21Nov04
+- Make authentication timeout compile time configurable.
+ The value is set in src/baconfig.h
+- Fix removing items from watchdog queue, which apparently
+ screwed up if there was more than one item.
+- Rework mediaformat part of manual to separate out old
+ tape format for easier reading.
+- Add a lot of debug code to the authentication code.
+- Add seconds to the start/end times printed in the job report.
+19Nov04
+- Fix mutex deadlock in dequeue of messages.
+- Add debug code to FD authorization.
18Nov04
- Increase authentication timeouts to 10 minutes.
15Nov04
Code falling under the above conditions will be marked as follows:
+ Copyright (C) 2000-2005 Kern Sibbald
+or
Copyright (C) 2000-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
cd $(srcdir);
${RMF} -f config.cache config.log config.out config.status src/config.h
- WANT_AUTOCONF=2.5 autoconf --prepend-include=$(srcdir)/autoconf \
+ autoconf --prepend-include=$(srcdir)/autoconf \
autoconf/configure.in > configure
chmod 755 configure
autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
cd $(srcdir);
${RMF} -f config.cache config.log config.out config.status src/config.h
- WANT_AUTOCONF=2.5 autoheader --prepend-include=$(srcdir)/autoconf \
+ autoheader --prepend-include=$(srcdir)/autoconf \
autoconf/configure.in > autoconf/config.h.in
chmod 644 autoconf/config.h.in
@(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
@$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
@$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
+ @$(RMF) -r autom4te.cache
+ @find . -name .#* -exec $(RMF) {} \;
# clean for distribution
- Release Notes for Bacula 1.36.0
-
- Bacula code: Total files = 396 Total lines = 116,418 (*.h *.c *.in)
-
-
-Major Changes:
-- Tray monitor program (really cool)
-- Bacula Rescue CDROM (easy to make and essential for emergencies)
-- Bacula CD Image Manager
-- General bug fixes/stabilization
-- French translation of manual by Ludovic Strappazon well
- underway.
-- UTF-8 is supported in conio.
-- Improved conf scanning code allowing FileSet components to
- be put on a single line (previously everything had to be on
- a different line).
-- Win32 files restored to an alternate directory will have the
- colon following the drive letter turned into a / e.g. c:
- becomes c/. Previously the c: was stripped. This applies only
- to files written to an alternate directory (i.e. using a where=).
-- Certain open files (Word for example) can now be saved on
- Win32 systems.
-- Default for Wild-cards on Win32 systems is to fold case this
- should correct most of the problems users are having with
- exclusion on Win32.
-- Lots of improvements in the Rescue scripts -- better
- network detection, better mounting code, ...
-- The attributes spool file can now exceed 2GB.
-- Significant speed improvements when running PostgreSQL.
-- Significantly faster restore command with very large
- FileSets while building the in memory directory tree.
-- Patches directory in the source will have all patches
- that have not been applied and released (new releases are
- only generated when really critical bugs are found).
-- Bacula forces the tape drive into variable block mode
- on most systems (providing Bacula is running in variable
- block mode).
-- dbcheck updated to remove many more orphaned records.
-- Support for IPv6 (untested).
-- Modifications to the license to termination clause for
- more protection from SCO type predators. No change for
- normal users.
-- SIGHUP to Director causes it to reload conf file.
-
-- Many improvements in the documentation.
-
-New Directives:
-- Added "Rerun Failed levels = yes/no" in the Job resource
- of the Director. It will upgrade the current job to a
- higher level (Full or Differential) if a previous job
- of that level failed.
-- Added "Ignore FileSet Changes = yes/no" in the FileSet
- directive of the Director. It prevents the Director from
- immediately upgrading the job to a Full save if you modify
- the contents of the FileSet. Not recommended.
-- Added "Block positioning = yes/no" in Device resource in SD.
- If set to no, Bacula should (as yet untested) be able to
- recover data from tapes where the drive was set to fixed
- blocksize but Bacula is in variable block size.
-- Added "Multiple connections = yes/no" in Catalog record for
- allowing multiple simultaneous connections to the database.
- This is a major performance improvement for PostgreSQL and
- SQLite, but it is untested, so please test before putting
- it into production.
-- Alert Command in SD permits checking for tape drive
- alerts at the end of every job (or doing anything you want).
- An example of the command is in the default bacula-sd.conf
- file as well as in the Storage Configuration chapter of
- the manual.
+ Release Notes for Bacula 1.36.3
+
+ Bacula code: Total files = 398 Total lines = 118,000 (*.h *.c *.in)
+
+Major Changes to version 1.36.3:
+- Applied all fixes for bugs since version 1.36.2 (see below)
+- Use fseeko and ftello so that attributes can exceed 4 GB.
+- Thanks to Karl Cunningham's hard work and skilled Perl
+ programming, the manual is now in LaTeX format
+ and has an index!
+- Drop support of old style Include/Excludes (see below).
+
+New Directives in 1.36.3:
+- None, but see 1.36.2 additions below.
New Commands:
-- umount -- same as unmount.
-- delete job now permits multiple jobids and ranges, e.g.:
- delete job jobid=1,3,5,11-16
-- reload -- reloads bacula-dir.conf in Director.
+- None since 1.36.1
+
+Items to note for 1.36.3!!!
+- Drop support of old style Include/Excludes. Matt Howard has
+ supplied a handy Perl program that will do a good job of
+ converting your FileSets. It can be found in
+ examples/conf/fileset_convert.pl
+- Dan has reminded us that the arguments for make_catalog_backup
+ changed from 1.34.x to 1.36.1. The old arguments were typically
+ "-U bacula". The new arguments are typically "bacula bacula",
+ where the first is the database name, and the second is the
+ user name.
+
+Patches applied:
+
+04Mar05 1.36.2-level.patch
+ This patch should fix a problem with th %l editing in the
+ client (FD) where it edited nothing. With this fix, it should
+ edit "since".
+
+04Mar05 1.36.2-pool.patch
+ This patch corrects a problem preventing multiple
+ simultaneous jobs from different pools.
+
+09Mar05 1.36.2-win32-drive.patch
+ This patch will prevent the Win32 FD from printing an error message
+ when it attempts to restore the permissions for a drive (which Win32
+ doesn't permit). The error is harmless in any case.
+
+15Mar05 1.36.2-netbsd.patch
+ This patch corrects a compile problem because of no statfs()
+ on NetBSD. The patch was submitted by kardel with bug 258.
+
+16Mar05 1.36.2-console.patch
+ This patch causes the output directed to a file to be
+ flushed after every line. This is a bit overkill, IMO, but
+ a user complained about it.
+
+17Mar05 1.36.2-restore-speed.patch
+ This patch will fix a subtle bug that was introduced in 1.36.2
+ which causes Bacula to be very slow restoring a few files. This
+ is because it reads completely to the end of the Volume rather
+ than stopping when all the files on the Volume are loaded. The
+ introduction of the bug was caused by a patch that fixed
+ Bacula truncating tapes after a restore.
+ Note that all source files will be rebuilt during the make.
+
+18Mar05 1.36.2-store.patch
+ This patch fails a job if no Storage resource is specified and
+ the job attempts to call the SD.
+
+18Mar05 1.36.2-reschedule.patch
+ This patch should fix a Segfault bug when a job is rescheduled.
+ The storage pointers were being released when they should not
+ have been.
+
+24Mar05 1.36.2-wx-console-bugfixes.patch
+ Major wx-console fixes (see src/wx-console/CHANGELOG for details).
+
+28Mar05 1.36.2-tray-monitor-memleak.patch
+ This patch should fix memory leaks in tray-monitor.
-Items to note!!!
+================================================================
+
+Items to note for 1.36.2!!!
+- Dan has reminded us that the arguments for make_catalog_backup
+ changed from 1.34.x to 1.36.1. The old arguments were typically
+ "-U bacula". The new arguments are typically "bacula bacula",
+ where the first is the database name, and the second is the
+ user name.
+
+Patches applied:
+
+03Dec04 1.36.1-pool.patch
+ This patch should hold jobs in the Director's start queue if
+ more than one simultaneous backup job wants to use the same
+ Storage device with two different Pools (i.e. 2 Volumes).
+
+03Dec04 1.16.1-slots.patch
+ This patch should fix "update slots" with two different
+ magazines in different pools by checking the pool when zapping
+ the InChanger.
+
+18Dec04 1.36.1-spool.patch
+ This patch fixes the despooling size printed in the Job
+ report. Previously, it reported the total size for the
+ device. This patch makes it report the size for the job.
+
+21Dec04 1.36.1-store.patch
+ This patch fixes a problem with overriding storage daemon
+ specifications. Previously they were not always honored.
+ This implements more uniform handling. It also eliminates
+ an orphaned buffer situation using JobDefs.
+
+21Dec04 1.36.1-reload.patch
+ This patch fixes Bacula so that it does not exit if there
+ is a syntax error in its conf file during a reload command.
+
+24Dec04 1.36.1-fileset.patch
+ This patch should correct a seg fault in the FD that occurs
+ at the end of a job when the job uses old style include/excludes.
+ Old style include/excludes are deprecated and should be
+ converted to the new style as soon as possible.
+
+30Jan05 1.36.1-acl.patch
+ This patch fixes some typos with ACL checking that results
+ in the incorrect name being used for the check.
+ This fixes possible security problems with unwanted
+ access by restricted consoles.
+
+15Feb05 1.36.1-truncate.patch
+ This patch fixes a bug where a tape gets "truncated" after
+ doing a restore. The number of files in the catalog do not
+ agree with what Bacula thinks is on tape, then the tape is
+ marked in error.
+
+===
+Items to note for version 1.36.1:
+- The output from Job reports has been modified to include the
+ seconds on the start/end times, the Storage device used, and to
+ indent the output differently.
+- If you created a PostgreSQL database under version 1.36.0, there
+ are two things you might want to do. 1. manually remove some
+ of the File table indexes to improve backup performance. See the
+ make_postgresql_tables script. 2. run fix_postgresql_tables (in
+ src/cats and updatedb) to correct a table. This is necessary only
+ if you are creating disk Volumes greater than 2GB.
- As of 1.35.5 you MUST do a database update.
cd scripts-dir (or src/cats)
of the new FileSet features such as regular expressions.
- Regular expressions are not supported in the Win32 FD.
-Other Items:
-- Much better error messages from system errors particularly
- on Win32 and in running scripts.
-- Many improvements in the SD.
-- Full support for 64 bit machines.
-- btape improved test and fill commands.
-- See the ChangeLog for additional details.
+Major Changes to version 1.36.1:
+- There is a new Win32 pebuilder rescue disk thanks to Scott. This
+ is worth the effort to checkout.
+- A number of indexes have been removed from the PostgreSQL
+ database to improve performance during backups. You may need to
+ add these indexes if you do Verifies. See the scripts.
+- We now have a Gentoo ebuild -- thanks Scott.
+- There are a number of new ./configure options for the
+ bimagemgr. Please see the documentation or ./configure --help
+- The RedHat autostart scripts disable using /lib/tls. If you
+ don't want this you will need to turn it off.
+- Corrected a problem with the default SD and FD conf files that
+ incorrectly set Maximum Concurrent Jobs = 1. This prevented
+ running a job and obtaining the status at the same time.
+- All daemon messages are now prefixed with a short date/time,
+ and queued messages (generated in the comm routines) have the
+ time the message was generated rather than the time the message
+ was sent (usually much later).
+- Fixed a bug with the autochanger code not respecting the InChanger
+ flag.
+
+Other Items:
+- It is now possible to build the Rescue CDROM using a pre-installed
+ static Bacula FD.
+- Corrected a bug in the traceback code when Bacula was executed without
+ a path. Tracebacks should now work in more cases.
+- Corrected a typo in the traceback script.
+- Fixed the mtx autochanger script so that it correctly waits on
+ Linux systems (if you manually enable the code).
+- Added grant all on cdimages for PostgreSQL users of bimagemgr.
+- The actual Job start time is now correctly recorded in the catalog.
+- You can now specify a JobId (or multiple ones separated by commas) on
+ the restore command line.
+- A -d50 will now turn on lots of debug code if you are having
+ authentication errors.
+- Found a workaround to a /lib/tls pthreads bug (a library seg fault).
+- Added an ALERT message class for Alert messages.
+- Fixed a seg fault in the restore tree routine when attempting
+ to select certain files in the root directory.
+- Allow other jobs to request new Volumes while operator intervention
+ is needed -- previously all stalled.
+- Enhancements to btape test (don't loop if certain tape errors occur).
+- Improvements to the Win32 install.
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if your system has a working POSIX `fnmatch' function. */
-#undef HAVE_FNMATCH
-
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
+/* Define to 1 if you have the `fseeko' function. */
+#undef HAVE_FSEEKO
+
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* 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. */
AC_PATH_PROG(RM, rm, rm)
AC_PATH_PROG(CP, cp, cp)
AC_PATH_PROG(SED, sed, sed)
-AC_PATH_PROG(AWK, awk, awk)
AC_PATH_PROG(ECHO, echo, echo)
AC_PATH_PROG(CMP, cmp, cmp)
AC_PATH_PROG(TBL, tbl, tbl)
AC_PATH_PROG(MTX, mtx, mtx)
AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
AC_PATH_PROG(WXCONFIG, wx-config, wx-config)
-AC_PATH_PROG(CDRECORD, cdrecord)
+AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
+AC_PATH_PROG(PIDOF, pidof, pidof)
+AC_PROG_AWK
+# Some AWK programs fail, so test it and warn the user
+if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
+ { if ((prog == $2) || (("(" prog ")") == $2) ||
+ (("[" prog "]") == $2) ||
+ ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
+else
+ AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
+ The regex engine of $AWK is too broken to be used you
+ might want to install GNU AWK.
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
+fi
+THE_AWK=$AWK
+AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
+
test -n "$ARFLAG" || ARFLAGS="cr"
AC_SUBST(ARFLAGS)
support_static_sd=no
support_static_dir=no
support_static_cons=no
+support_python=no
build_client_only=no
cats=
db_name=Internal
bimagemgr_dataowner=apache
AC_ARG_WITH(bimagemgr-dataowner,
- [ --with-bimagemgr-dataowner=USER specify bimagemgr data file owner],
+ [ --with-bimagemgr-dataowner=USER specify bimagemgr data file owner],
[
if test "x$withval" != "xno" ; then
bimagemgr_dataowner=$withval
bimagemgr_datagroup=apache
AC_ARG_WITH(bimagemgr-datagroup,
- [ --with-bimagemgr-datagroup=USER specify bimagemgr data file group],
+ [ --with-bimagemgr-datagroup=USER specify bimagemgr data file group],
[
if test "x$withval" != "xno" ; then
bimagemgr_datagroup=$withval
AC_CHECK_FUNCS(chflags)
-AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
+AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname fseeko)
dnl# --------------------------------------------------------------------------
dnl# CHECKING FOR THREAD SAFE FUNCTIONS
AC_FUNC_GETMNTENT
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SETPGRP dnl check for BSD setpgrp.
-AC_FUNC_FNMATCH
+# AC_FUNC_FNMATCH dnl use local version
dnl# FreeBSD needs to link libxpg4
scripts/gnome-console.console_apps \
scripts/mtx-changer \
scripts/bacula-tray-monitor.desktop \
+ scripts/logwatch/Makefile \
+ scripts/logwatch/logfile.bacula.conf \
doc/Makefile \
src/Makefile \
src/host.h \
src/win32/Makefile \
src/win32/console/bconsole.conf \
src/win32/wx-console/wx-console.conf \
- src/win32/pebuilder/Makefile \
- src/bimagemgr/Makefile \
- src/bimagemgr/bacula-bimagemgr.spec \
+ src/win32/pebuilder/Makefile \
+ src/bimagemgr/Makefile \
+ src/bimagemgr/bacula-bimagemgr.spec \
$PFILES ],
[(echo "Doing make of dependencies"; ${MAKE:-make} depend;) ]
)
# old stuff
# cweb support: ${got_cweb} ${CWEB_SRC}
- # gmp support: ${got_gmp} ${GMP_SRC}
+# gmp support: ${got_gmp} ${GMP_SRC}
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG VERSION DATE LSMDATE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB MV RM CP SED AWK ECHO CMP TBL AR OPENSSL MTX PKGCONFIG WXCONFIG CDRECORD ARFLAGS MAKE_SHELL LOCAL_LIBS LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE INSIDE_GNOME_COMMON_TRUE INSIDE_GNOME_COMMON_FALSE MSGFMT GNOME_INCLUDEDIR GNOMEUI_LIBS GNOME_LIBDIR GNOME_LIBS GNOMEGNORBA_LIBS GTKXMHTML_LIBS ZVT_LIBS GNOME_CONFIG ORBIT_CONFIG ORBIT_IDL HAVE_ORBIT_TRUE HAVE_ORBIT_FALSE ORBIT_CFLAGS ORBIT_LIBS HAVE_GNORBA_TRUE HAVE_GNORBA_FALSE GNORBA_CFLAGS GNORBA_LIBS GNOME_APPLETS_LIBS GNOME_DOCKLETS_LIBS GNOME_CAPPLET_LIBS GNOME_DIR WXCONS_CPPFLAGS WXCONS_LDFLAGS WX_DIR TRAY_MONITOR_CPPFLAGS TRAY_MONITOR_LDFLAGS TRAY_MONITOR_DIR TTOOL_LDFLAGS STATIC_FD STATIC_SD STATIC_DIR STATIC_CONS STATIC_GNOME_CONS STATIC_WX_CONS ALL_DIRS CONS_INC CONS_OBJ CONS_SRC CONS_LIBS CONS_LDFLAGS READLINE_SRC CDSTL working_dir scriptdir dump_email job_email smtp_host piddir subsysdir baseport dir_port fd_port sd_port dir_password fd_password sd_password mon_dir_password mon_fd_password mon_sd_password bimagemgr_cgidir bimagemgr_docdir bimagemgr_binowner bimagemgr_bingroup bimagemgr_dataowner bimagemgr_datagroup dir_user dir_group sd_user sd_group fd_user fd_group SBINPERM SQL_LFLAGS SQL_INCLUDE SQL_BINDIR cats DB_NAME GETCONF ac_ct_GETCONF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBOBJS ALLOCA FDLIBS DEBUG DINCLUDE DLIB DB_LIBS WCFLAGS WLDFLAGS OBJLIST hostname TAPEDRIVE PSCMD WIN32 MACOSX DISTNAME DISTVER LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BUILD_DIR TRUEPRG FALSEPRG VERSION DATE LSMDATE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB MV RM CP SED ECHO CMP TBL AR OPENSSL MTX PKGCONFIG WXCONFIG CDRECORD PIDOF AWK ARFLAGS MAKE_SHELL LOCAL_LIBS LOCAL_CFLAGS LOCAL_LDFLAGS LOCAL_DEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_IRIX_OS_TRUE HAVE_IRIX_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE INSIDE_GNOME_COMMON_TRUE INSIDE_GNOME_COMMON_FALSE MSGFMT GNOME_INCLUDEDIR GNOMEUI_LIBS GNOME_LIBDIR GNOME_LIBS GNOMEGNORBA_LIBS GTKXMHTML_LIBS ZVT_LIBS GNOME_CONFIG ORBIT_CONFIG ORBIT_IDL HAVE_ORBIT_TRUE HAVE_ORBIT_FALSE ORBIT_CFLAGS ORBIT_LIBS HAVE_GNORBA_TRUE HAVE_GNORBA_FALSE GNORBA_CFLAGS GNORBA_LIBS GNOME_APPLETS_LIBS GNOME_DOCKLETS_LIBS GNOME_CAPPLET_LIBS GNOME_DIR WXCONS_CPPFLAGS WXCONS_LDFLAGS WX_DIR TRAY_MONITOR_CPPFLAGS TRAY_MONITOR_LDFLAGS TRAY_MONITOR_DIR TTOOL_LDFLAGS STATIC_FD STATIC_SD STATIC_DIR STATIC_CONS STATIC_GNOME_CONS STATIC_WX_CONS ALL_DIRS CONS_INC CONS_OBJ CONS_SRC CONS_LIBS CONS_LDFLAGS READLINE_SRC CDSTL working_dir scriptdir dump_email job_email smtp_host piddir subsysdir baseport dir_port fd_port sd_port dir_password fd_password sd_password mon_dir_password mon_fd_password mon_sd_password bimagemgr_cgidir bimagemgr_docdir bimagemgr_binowner bimagemgr_bingroup bimagemgr_dataowner bimagemgr_datagroup dir_user dir_group sd_user sd_group fd_user fd_group SBINPERM SQL_LFLAGS SQL_INCLUDE SQL_BINDIR cats DB_NAME GETCONF ac_ct_GETCONF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBOBJS ALLOCA FDLIBS DEBUG DINCLUDE DLIB DB_LIBS WCFLAGS WLDFLAGS OBJLIST hostname TAPEDRIVE PSCMD WIN32 MACOSX DISTNAME DISTVER LTLIBOBJS'
ac_subst_files='MCOMMON'
# Initialize some variables set by options.
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
--with-bimagemgr-docdir=DIR specify bimagemgr doc root dir
--with-bimagemgr-binowner=USER specify bimagemgr binary file owner
--with-bimagemgr-bingroup=USER specify bimagemgr binary file group
- --with-bimagemgr-dataowner=USER specify bimagemgr data file owner
- --with-bimagemgr-datagroup=USER specify bimagemgr data file group
+ --with-bimagemgr-dataowner=USER specify bimagemgr data file owner
+ --with-bimagemgr-datagroup=USER specify bimagemgr data file group
--with-dir-user=USER specify user for Director daemon
--with-dir-group=GROUP specify group for Director daemon
--with-sd-user=USER specify user for Storage daemon
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
if $ac_init_version; then
cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
# Get rid of the leading space.
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
*ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
;;
*)
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
}
for ac_var in $ac_subst_files
do
eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
+ ;;
conftest.$ac_ext )
- # This is the source file.
- ;;
+ # This is the source file.
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
* )
- break;;
+ break;;
esac
done
else
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
+ export ac_cv_exeext
+ break;;
* ) break;;
esac
done
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_prog_cc_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_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=$?
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_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=$?
ac_cv_prog_cxx_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
fi
fi
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_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=$?
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_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=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); };
then
- # cc works too.
- :
+ # cc works too.
+ :
else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
fi
fi
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
(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
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
(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
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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_pattern="Autoconf.*'x'"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
if test $ac_cv_prog_gcc_traditional = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
case $as_dir/ in
./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
done
;;
echo "${ECHO_T}no" >&6
fi
-# Extract the first word of "awk", so it can be a program name with args.
-set dummy awk; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $AWK in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="awk"
- ;;
-esac
-fi
-AWK=$ac_cv_path_AWK
-
-if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
# Extract the first word of "echo", so it can be a program name with args.
set dummy echo; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
done
done
+ test -z "$ac_cv_path_CDRECORD" && ac_cv_path_CDRECORD="cdrecord"
;;
esac
fi
echo "${ECHO_T}no" >&6
fi
+# Extract the first word of "pidof", so it can be a program name with args.
+set dummy pidof; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PIDOF+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PIDOF in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PIDOF="$PIDOF" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PIDOF="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PIDOF" && ac_cv_path_PIDOF="pidof"
+ ;;
+esac
+fi
+PIDOF=$ac_cv_path_PIDOF
+
+if test -n "$PIDOF"; then
+ echo "$as_me:$LINENO: result: $PIDOF" >&5
+echo "${ECHO_T}$PIDOF" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+# Some AWK programs fail, so test it and warn the user
+if echo xfoo | $AWK 'BEGIN { prog=ARGV1; ARGC=1 }
+ { if ((prog == $2) || (("(" prog ")") == $2) ||
+ (("" prog "") == $2) ||
+ ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
+else
+ { { echo "$as_me:$LINENO: error: !!!!!!!!! WARNING !!!!!!!!!!!!!!
+ The regex engine of $AWK is too broken to be used you
+ might want to install GNU AWK.
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >&5
+echo "$as_me: error: !!!!!!!!! WARNING !!!!!!!!!!!!!!
+ The regex engine of $AWK is too broken to be used you
+ might want to install GNU AWK.
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+THE_AWK=$AWK
+# Extract the first word of "$THE_AWK", so it can be a program name with args.
+set dummy $THE_AWK; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $AWK in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="$THE_AWK"
+ ;;
+esac
+fi
+AWK=$ac_cv_path_AWK
+
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
test -n "$ARFLAG" || ARFLAGS="cr"
case $host_os in
*cygwin* ) CYGWIN=yes;;
- * ) CYGWIN=no;;
+ * ) CYGWIN=no;;
esac
if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
support_static_sd=no
support_static_dir=no
support_static_cons=no
+support_python=no
build_client_only=no
cats=
db_name=Internal
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_header_stdc=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
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 <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
:
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
+ || toupper (i) != TOUPPER (i))
exit(2);
exit (0);
}
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
+ inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ 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 -s conftest.$ac_objext'
+ { 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=$?
eval "$as_ac_Header=no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo "$as_me:$LINENO: checking termcap.h usability" >&5
echo $ECHO_N "checking termcap.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking termcap.h presence" >&5
echo $ECHO_N "checking termcap.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: termcap.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: termcap.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: termcap.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: termcap.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: termcap.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: termcap.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: termcap.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: termcap.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: termcap.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: termcap.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: termcap.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: termcap.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: termcap.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermcap $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_termcap_tgetent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_ncurses_tgetent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_header_term_h=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_term_h" >&5
echo "${ECHO_T}$ac_cv_header_term_h" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_curses_tgetent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5
echo "$as_me:$LINENO: checking ${with_readline}/readline.h usability" >&5
echo $ECHO_N "checking ${with_readline}/readline.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking ${with_readline}/readline.h presence" >&5
echo $ECHO_N "checking ${with_readline}/readline.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: ${with_readline}/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: ${with_readline}/readline.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: ${with_readline}/readline.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${with_readline}/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${with_readline}/readline.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo "$as_me:$LINENO: checking /usr/include/readline/readline.h usability" >&5
echo $ECHO_N "checking /usr/include/readline/readline.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking /usr/include/readline/readline.h presence" >&5
echo $ECHO_N "checking /usr/include/readline/readline.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: /usr/include/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: /usr/include/readline/readline.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: /usr/include/readline/readline.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: /usr/include/readline/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: /usr/include/readline/readline.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
echo "$as_me:$LINENO: checking ${TOP_DIR}/depkgs/readline/readline.h usability" >&5
echo $ECHO_N "checking ${TOP_DIR}/depkgs/readline/readline.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking ${TOP_DIR}/depkgs/readline/readline.h presence" >&5
echo $ECHO_N "checking ${TOP_DIR}/depkgs/readline/readline.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${TOP_DIR}/depkgs/readline/readline.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
eval "$as_ac_Header=no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
for ac_lib in dir; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
for ac_lib in x; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define socket to an innocuous variant, in case <limits.h> declares socket.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define socket innocuous_socket
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket (); 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 socket
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_socket=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
echo "${ECHO_T}$ac_cv_func_socket" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxnet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_xnet_socket=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_socket" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_socket_socket=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-linet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_inet_socket=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_inet_socket" >&5
echo "$as_me:$LINENO: checking for libwrap" >&5
echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
LIBS="$saved_LIBS -lwrap -lnsl"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
{ (exit 1); exit 1; }; }
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define crypt to an innocuous variant, in case <limits.h> declares crypt.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define crypt innocuous_crypt
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char crypt (); 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 crypt
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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); }; }; then
- ac_cv_func_crypt=yes
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (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_cv_func_crypt=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_crypt=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_crypt" >&5
echo "${ECHO_T}$ac_cv_func_crypt" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_crypt_crypt=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
ac_save_CC="$CC"
CC="$CC $ac_cv_sys_largefile_CFLAGS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_sys_largefile_CFLAGS=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
CC="$ac_save_CC"
esac
}
# Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
for ac_extension in a so sl; do
if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
- test -f $ac_im_libdir/libX11.$ac_extension; then
- ac_im_usrlibdir=$ac_im_libdir; break
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
fi
done
# Screen out bogus values from the imake configuration. They are
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
ac_save_LIBS=$LIBS
LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
done
done
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi # $ac_x_libraries = no
if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
else
# Record where we found X for the cache.
ac_cv_have_x="have_x=yes \
- ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
fi
fi
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_R_nospace=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test $ac_R_nospace = yes; then
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_R_space=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test $ac_R_space = yes; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_dnet_dnet_ntoa=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_dnet_stub_dnet_ntoa=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
fi
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS="$ac_xsave_LIBS"
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname innocuous_gethostbyname
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname (); 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 gethostbyname
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_gethostbyname=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_nsl_gethostbyname=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
- echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+ echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_bsd_gethostbyname=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define connect innocuous_connect
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect (); 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 connect
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_connect=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
echo "${ECHO_T}$ac_cv_func_connect" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_socket_connect=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define remove innocuous_remove
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove (); 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 remove
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_remove=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
echo "${ECHO_T}$ac_cv_func_remove" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_posix_remove=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shmat innocuous_shmat
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat (); 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 shmat
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_shmat=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
echo "${ECHO_T}$ac_cv_func_shmat" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_ipc_shmat=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_ICE_IceConnectionNumber=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_header_stdc=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
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 <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
:
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
+ || toupper (i) != TOUPPER (i))
exit(2);
exit (0);
}
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_header_sys_types_h_makedev=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
eval "$as_ac_Header=no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
for ac_lib in dir; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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); }; }; then
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (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_cv_search_opendir="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
for ac_lib in x; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_header_sys_wait_h=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_header_time=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_member_struct_stat_st_blksize=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_member_struct_stat_st_blocks=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
_ACEOF
else
- LIBOBJS="$LIBOBJS fileblocks.$ac_objext"
+ case $LIBOBJS in
+ "fileblocks.$ac_objext" | \
+ *" fileblocks.$ac_objext" | \
+ "fileblocks.$ac_objext "* | \
+ *" fileblocks.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;;
+esac
+
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_struct_tm=sys/time.h
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
echo "${ECHO_T}$ac_cv_struct_tm" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_member_struct_tm_tm_zone=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_var_tzname=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
echo "${ECHO_T}$ac_cv_var_tzname" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ba_cv_header_utime_h=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ba_cv_header_utime_h" >&5
echo "${ECHO_T}$ba_cv_header_utime_h" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ba_cv_header_socklen_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ba_cv_header_socklen_t" >&5
echo "${ECHO_T}$ba_cv_header_socklen_t" >&6
ba_cv_bigendian=no
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
( exit $ac_status )
ba_cv_bigendian=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ba_cv_bigendian" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_c_const=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
echo "${ECHO_T}$ac_cv_c_const" >&6
fstype=no
# The order of these tests is important.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
rm -f conftest.err conftest.$ac_ext
if test $fstype = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
fi
if test $fstype = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
fi
if test $fstype = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
fi
if test $fstype = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
fi
if test $fstype = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_signal=int
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
echo "${ECHO_T}$ac_cv_type_signal" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
bash_cv_signal_vintage=v7
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_mode_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
echo "${ECHO_T}$ac_cv_type_mode_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_size_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_pid_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
echo "${ECHO_T}$ac_cv_type_pid_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_off_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
echo "${ECHO_T}$ac_cv_type_off_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_ino_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_ino_t" >&5
echo "${ECHO_T}$ac_cv_type_ino_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_dev_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_dev_t" >&5
echo "${ECHO_T}$ac_cv_type_dev_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_daddr_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_daddr_t" >&5
echo "${ECHO_T}$ac_cv_type_daddr_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_major_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_major_t" >&5
echo "${ECHO_T}$ac_cv_type_major_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_minor_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_minor_t" >&5
echo "${ECHO_T}$ac_cv_type_minor_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_ssize_t=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_member_struct_stat_st_blocks=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6
_ACEOF
else
- LIBOBJS="$LIBOBJS fileblocks.$ac_objext"
+ case $LIBOBJS in
+ "fileblocks.$ac_objext" | \
+ *" fileblocks.$ac_objext" | \
+ "fileblocks.$ac_objext "* | \
+ *" fileblocks.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;;
+esac
+
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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); }; }; then
- ac_cv_member_struct_stat_st_rdev=yes
-else
+ (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_cv_member_struct_stat_st_rdev=yes
+else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_member_struct_stat_st_rdev=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_struct_tm=sys/time.h
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
echo "${ECHO_T}$ac_cv_struct_tm" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_c_const=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
echo "${ECHO_T}$ac_cv_c_const" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_char=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
echo "${ECHO_T}$ac_cv_type_char" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_char=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_short_int=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_short_int" >&5
echo "${ECHO_T}$ac_cv_type_short_int" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_short_int=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_int=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
echo "${ECHO_T}$ac_cv_type_int" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_long_int=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_int" >&5
echo "${ECHO_T}$ac_cv_type_long_int" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_int=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_long_long_int=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long_int=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_type_int_p=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5
echo "${ECHO_T}$ac_cv_type_int_p" >&6
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
ac_lo= ac_hi=
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int_p=$ac_lo;;
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_u_int="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_u_int" >&5
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_intmax_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_u_intmax_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_u_intmax_t" >&5
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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'
+ (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=$?
ac_cv_have_intxx_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_intxx_t" >&5
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_int64_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_int64_t" >&5
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_u_intxx_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_u_intxx_t" >&5
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_u_int64_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_u_int64_t" >&5
echo "$as_me:$LINENO: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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 "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test -z "$have_u_intxx_t" ; then
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_have_uintxx_t="no"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_uintxx_t" >&5
echo "$as_me:$LINENO: checking for int64_t and u_int64_t types in sys/bitypes.h" >&5
echo $ECHO_N "checking for int64_t and u_int64_t types in sys/bitypes.h... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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 "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if (test -z "$have_uintxx_t" && \
echo "$as_me:$LINENO: checking for uintXX_t types in sys/bitypes.h" >&5
echo $ECHO_N "checking for uintXX_t types in sys/bitypes.h... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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 "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-for ac_func in snprintf vsnprintf gethostid getdomainname
+
+for ac_func in snprintf vsnprintf gethostid getdomainname fseeko
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 "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define gethostbyname_r to an innocuous variant, in case <limits.h> declares gethostbyname_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname_r innocuous_gethostbyname_r
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname_r (); 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 gethostbyname_r
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_gethostbyname_r=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_nsl_gethostbyname_r=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname_r" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_resolv_gethostbyname_r=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname_r" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_cv_struct_sockaddr_sa_len=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_sa_len" >&5
echo "${ECHO_T}$ac_cv_struct_sockaddr_sa_len" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_ipv6_support=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_ipv6_support" >&5
echo "${ECHO_T}$ac_cv_ipv6_support" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_intl_strftime=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define _doprnt innocuous__doprnt
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt (); 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 _doprnt
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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'
+ { (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_exeext'
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func__doprnt=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
echo "${ECHO_T}$ac_cv_func__doprnt" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_working_alloca_h=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_alloca_works=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
ac_cv_c_stack_direction=0
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
( exit $ac_status )
ac_cv_c_stack_direction=-1
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsun $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_sun_getmntent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lseq $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_seq_getmntent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgen $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_gen_getmntent=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* 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 gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
ac_cv_func_closedir_void=yes
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
( exit $ac_status )
ac_cv_func_closedir_void=yes
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
( exit $ac_status )
ac_cv_func_setpgrp_void=yes
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
_ACEOF
fi
- echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5
-echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6
-if test "${ac_cv_func_fnmatch_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Some versions of Solaris, SCO, and the GNU C Library
- # have a broken or incompatible fnmatch.
- # So we run a test program. If we are cross-compiling, take no chance.
- # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
- if test "$cross_compiling" = yes; then
- ac_cv_func_fnmatch_works=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <fnmatch.h>
-# define y(a, b, c) (fnmatch (a, b, c) == 0)
-# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
-
-int
-main ()
-{
-exit
- (!(y ("a*", "abc", 0)
- && n ("d*/*1", "d/s/1", FNM_PATHNAME)
- && y ("a\\\\bc", "abc", 0)
- && n ("a\\\\bc", "abc", FNM_NOESCAPE)
- && y ("*x", ".x", 0)
- && n ("*x", ".x", FNM_PERIOD)
- && 1));
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (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_cv_func_fnmatch_works=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_fnmatch_works=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5
-echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6
-if test $ac_cv_func_fnmatch_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FNMATCH 1
-_ACEOF
-
-fi
-
-
-
+ # AC_FUNC_FNMATCH dnl use local version
echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxpg4 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_xpg4_setlocale=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsun $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_sun_getpwnam=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getpwnam" >&5
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=$ac_header_preproc"
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_z_deflate=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
echo "$as_me:$LINENO: checking sys/acl.h usability" >&5
echo $ECHO_N "checking sys/acl.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&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 -s conftest.$ac_objext'
+ { 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=$?
ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+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
echo "$as_me:$LINENO: checking sys/acl.h presence" >&5
echo $ECHO_N "checking sys/acl.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
(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
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
{ echo "$as_me:$LINENO: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+ { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/acl.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
;;
- no:yes )
+ no:yes:* )
{ echo "$as_me:$LINENO: WARNING: sys/acl.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sys/acl.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/acl.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/acl.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/acl.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/acl.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/acl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/acl.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/acl.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/acl.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/acl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/acl.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
ac_check_lib_save_LIBS=$LIBS
LIBS="-lacl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_acl_acl_get_file=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_pthread_pthread_create=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthreads $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_pthreads_pthread_create=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_lib_c_r_pthread_create=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define pthread_create to an innocuous variant, in case <limits.h> declares pthread_create.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define pthread_create innocuous_pthread_create
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_create (); 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 pthread_create
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&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 -s conftest$ac_exeext'
+ { 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_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_func_pthread_create=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_pthread_create" >&5
echo "${ECHO_T}$ac_cv_func_pthread_create" >&6
exit 1
fi
- ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/linux/floppy/Makefile rescue/linux/cdrom/Makefile rescue/linux/cdrom/bacula/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/bacula-tray-monitor.desktop doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile src/bimagemgr/Makefile src/bimagemgr/bacula-bimagemgr.spec $PFILES"
+ ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/linux/floppy/Makefile rescue/linux/cdrom/Makefile rescue/linux/cdrom/bacula/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile src/bimagemgr/Makefile src/bimagemgr/bacula-bimagemgr.spec $PFILES"
ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
} |
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
+s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
-s/^[^=]*=[ ]*$//;
+s/^[^=]*=[ ]*$//;
}'
fi
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
# 2. Add them.
ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ instantiate the configuration header FILE
Configuration files:
$config_files
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
"scripts/gnome-console.console_apps" ) CONFIG_FILES="$CONFIG_FILES scripts/gnome-console.console_apps" ;;
"scripts/mtx-changer" ) CONFIG_FILES="$CONFIG_FILES scripts/mtx-changer" ;;
"scripts/bacula-tray-monitor.desktop" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-tray-monitor.desktop" ;;
+ "scripts/logwatch/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/Makefile" ;;
+ "scripts/logwatch/logfile.bacula.conf" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/logfile.bacula.conf" ;;
"doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/host.h" ) CONFIG_FILES="$CONFIG_FILES src/host.h" ;;
s,@RM@,$RM,;t t
s,@CP@,$CP,;t t
s,@SED@,$SED,;t t
-s,@AWK@,$AWK,;t t
s,@ECHO@,$ECHO,;t t
s,@CMP@,$CMP,;t t
s,@TBL@,$TBL,;t t
s,@PKGCONFIG@,$PKGCONFIG,;t t
s,@WXCONFIG@,$WXCONFIG,;t t
s,@CDRECORD@,$CDRECORD,;t t
+s,@PIDOF@,$PIDOF,;t t
+s,@AWK@,$AWK,;t t
s,@ARFLAGS@,$ARFLAGS,;t t
s,@MAKE_SHELL@,$MAKE_SHELL,;t t
s,@LOCAL_LIBS@,$LOCAL_LIBS,;t t
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
case $INSTALL in
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
_ACEOF
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
ac_dC=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
# Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
_ACEOF
s,[\\$`],\\&,g
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
_ACEOF
# If some macros were called several times there might be several times
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
_ACEOF
# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo ' :' >>$CONFIG_STATUS
rm -f conftest.tail
# Write a limited-size here document to $tmp/defines.sed.
echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
# Write a limited-size here document to $tmp/undefs.sed.
echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
else
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_dest" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
ac_builddir=.
if test "$ac_dir" != .; then
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
# old stuff
# cweb support: ${got_cweb} ${CWEB_SRC}
- # gmp support: ${got_gmp} ${GMP_SRC}
+# gmp support: ${got_gmp} ${GMP_SRC}
--- /dev/null
+#!/usr/bin/perl
+#
+# A nice little script written by Matt Howard that will
+# convert old style Bacula FileSets into the new style.
+#
+# fileset_convert.pl bacula-dir.conf >output-file
+#
+use warnings;
+use strict;
+
+my $in;
+$in .= $_ while (<>);
+
+sub options {
+ return "Options { ".join('; ',split(/\s+/, shift)) . " } ";
+}
+
+sub file_lines {
+ return join($/, map {" File = $_"} split(/\n\s*/, shift));
+}
+
+$in =~ s/Include\s*=\s*((?:\w+=\w+\s+)*){\s*((?:.*?\n)+?)\s*}/
+ "Include { " .
+ ( $1 ? options($1) : '' ) . "\n" .
+ file_lines($2) .
+ "\n }\n" /eg;
+
+$in =~ s/Exclude\s*=\s*{\s*((?:.*?\n)+?)\s*}/
+ "Exclude {\n" . file_lines($1) . "\n }\n"/eg;
+
+print $in;
Kern's ToDo List
- 18 November 2004
+ 20 October 2004
Major development:
Project Developer
IPv6_2 Meno Abels
Data encryption Meno Abels (see projects)
Communication encryption Meno Abels
-Version 1.37 Kern (see below)
+Version 1.35 Kern (see below)
========================================================
-For 1.36.1:
-- Fix orphanned buffers:
- Orphaned buffer: 24 bytes allocated at line 808 of rufus-dir job.c
- Orphaned buffer: 40 bytes allocated at line 45 of rufus-dir alist.c
-- Add dump of VolSessionId/Time and FileIndex with bls.
-
-1.37 Projects:
-#3 Migration (Move, Copy, Archive Jobs)
-#4 Embedded Python Scripting
-#5 Events that call a Python program
-#6 Select one from among Multiple Storage Devices for Job
-#7 Single Job Writing to Multiple Storage Devices
-
-
-1.37 Possibilities:
-- Document testing
-- Add performance testing hooks
-- if 2 concurrent backups are attempted on the same tape
- drive (autoloader) into different tape pools, one of them will exit
- fatally instead of halting until the drive is idle
-- Add seconds to start and end times in the Job report output.
-- Add disk seeking on restore.
-- Document that ChangerDevice is used for Alert command.
-- Include within include does it work?
-- Implement a Pool of type Cleaning?
-- Implement VolReadTime and VolWriteTime in SD
-- Modify Backing up Your Database to include a bootstrap file.
-- Add restore of specific JobId to regression.
-- Think about making certain database errors fatal.
-- Look at correcting the time jump in the sceduler for daylight
- savings time changes.
-- Add a "real" timer to network connections.
-- Tell the "restore" user when browsing is no longer possible.
-- Write non-optimized bsrs from the JobMedia and Media records,
- even after Files are pruned.
-- Document that Bootstrap files can be written with cataloging
- turned off.
-- Look at adding full Volume and Pool information to a Volume
- label so that bscan can get *all* the info.
-- Promote to Full = Time period
-- Scratch Pool where the volumes can be re-assigned to any Pool.
-- Update StartTime if job held in Job Queue.
+1.35 Items to do for release:
+- Finish recovering from a disaster situation.
+ - How to get back a catalog.
+
+
+Maybe for 1.35:
- Despool attributes simultaneously with data in a separate
thread, rejoined at end of data spooling.
- Implement Files/Bytes,... stats for restore job.
- Add IPv6 to regression
- Perhaps add read/write programs and/or plugins to FileSets.
- How to handle backing up portables ...
+- Add "Rerun failed levels = yes/no" to Job resource.
- Add some sort of guaranteed Interval for upgrading jobs.
- Can we write the state file after every job terminates? On Win32
the system crashes and the state file is not updated.
up through the prompt.
- Detect fixed tape block mode during positioning by looking at
block numbers in btape "test". Possibly adjust in Bacula.
+- Implement a Client filename case fold option (default = fold
+ on Win32).
- Fix list volumes to output volume retention in some other
units, perhaps via a directive.
- If opening a tape in read/write mode fails attempt to open
it in read-only mode, and mark the tape for read only.
- Add a read-only mode to the mount option.
+- Add "Allow multiple connections" in Catalog resource to open a new
+ database connection for each job.
- Allow Simultaneous Priorities = yes => run up to Max concurrent jobs even
with multiple priorities.
+- Fix find_device in stored/dircmd.c:462 (see code)
- Add db check test to regression. Test each function like delete,
purge, ...
- If you use restore replace=never, the directory attributes for
non-existent directories will not be restored properly.
+Fix:
+ Kern,
+ mt status and tapeinfo output are attached. Default blocksize was
+ originally 512 bytes. I ran the following test on my machine:
+
+ - set defblksize to 512
+ - started bacula, labelled tape, ran job
+ - job completes with the following in log
+ SD termination status: OK
+ Termination: Backup OK
+ - restore attempts with blocksize set to 0 or 512 result in the familiar
+ "Volume data error! Wanted block-id BB02, got . Buffer discarded."
+
+
+ # tapeinfo -f /dev/sg0
+ Product Type: Tape Drive
+ Vendor ID: 'SONY '
+ Product ID: 'TSL-11000 '
+ Revision: 'L100'
+ Attached Changer: Yes
+ SerialNumber: '0010000443'
+ MinBlock:1
+ MaxBlock:16777215
+ SCSI ID: 1
+ SCSI LUN: 0
+ Ready: yes
+ BufferedMode: yes
+ Medium Type: Not Loaded
+ Density Code: 0x26
+ BlockSize: 512
+ DataCompEnabled: no
+ DataCompCapable: yes
+ DataDeCompEnabled: yes
+ CompType: 0x20
+ DeCompType: 0x20
+ BOP: yes
+ Block Position: 0
+
+ # mt -f /dev/nst0 status
+ SCSI 2 tape drive:
+ File number=0, block number=132, partition=0.
+ Tape block size 512 bytes. Density code 0x26 (DDS-4 or QIC-4GB).
+ Soft error count since last status=0
+ General status bits on (1010000):
+ ONLINE IM_REP_EN
+
+Wish list:
- see lzma401.zip in others directory for new compression
algorithm/library.
- Minimal autochanger handling in Bacula and in btape.
- Make ? do a help command (no return needed).
- Implement restore directory.
- Document streams and how to implement them.
+- Possibly implement "Ensure Full Backup = yes" looks for a failed full backup
+ and upgrades the current backup if one exists.
+- Check that barcode reading and update slots scan works.
- Try not to re-backup a file if a new hard link is added.
- Add feature to backup hard links only, but not the data.
- Fix stream handling to be simpler.
- Eliminate Restore "Run Restore Job" prompt by allowing new "run command
to be issued"
- Remove View FileSet button from Run a Job dialog.
+- Don't count higher level non-saved directories in Files expected
+ in restore report.
- Handle prompt for restore job at end of Restore command.
- Add display of total selected files to Restore window.
- Add tree pane to left of window.
fields.
- Fix option 2 of restore -- list where file is backed up -- require Client,
then list last 20 backups.
+- Add all pools in Dir conf to DB also update them to catch changed
+ LabelFormats and such.
- Pass Director resource name as an option to the Console.
- Add a "batch" mode to the Console (no unsolicited queries, ...).
- Add a .list all files in the restore tree (probably also a list all files)
did not exist.
- Use SHA1 on authentication if possible.
- See comtest-xxx.zip for Windows code to talk to USB.
+- Make btape accept Device Names in addition to Archive names.
- Add Events and Perl scripting.
- Add John's appended files:
Appended = { /files/server/logs/http/*log }
entirely upon the length.On a restore, the full and all incrementals
since it will beapplied in sequence to restore the file.
- Add a regression test for dbcheck.
-- Allow for optional cancelling of SD and FD in case DIR
+- Add disk seeking on restore. - Allow
+ for optional cancelling of SD and FD in case DIR
gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
- Add "limit=n" for "list jobs"
- Check new HAVE_WIN32 open bits.
in Job, Client, and Pool, with precedence such that Job overrides Client
which in turn overrides Pool.
+- Spooling ideas taken from Volker Sauer's and other's emails:
+ > IMHO job spooling should be turned on
+ >
+ > 1) by job
+ > 2) by schedule
+ > 3) by sd
+ >
+ > where and 2) overrides 1) and 3) is independent.
+
+ Yes, this is the minimum that I think is necessary.
+
+ >
+ > Reason(s):
+ > It should be switched by job, because the job that backs up the machine
+ > with the bacula-sd on doesn't need spooling.
+ > It should be switched by schedule, because for full-backups I don't need
+ > spooling, so I can switch it off (because the network faster then the
+ > tapedrive)
+
+ True, with the exception that if you have enough disk spool space,
+ and you want to run concurrent jobs, spooling can eliminate the block
+ interleaving restore inefficiencies.
+
+ > And you should be able to turn it of by sd for sd-machines with low disk
+ > capacity or if you just don't need or want this feature.
+ >
+ > There should be:
+ > - definitly the possibility for multipe spool direcories
+
+ Having multiple directories is no problem -- having different maximum
+ sizes creates specification problems. At some point, I will probably
+ have a common SD pool of spool directories as well as a set of
+ private spool directories for each device. The first implementation
+ will be a set of private spool directories for each device since
+ managing a global pool with a bunch of threads writing into the same
+ directory is *much* more complicated and prone to error.
+
+ > - the ability to spool parts of a backup (not the whole client)
+
+ This may change in the future, but for the moment, it will spool
+ either to a job high water mark, or until the directory is full
+ (reaches max spool size or I/O error). It will then write to tape,
+ truncate the spool file, and begin spooling again.
+
+ > - spooling while writing to tape
+
+ Not within a job, but yes, if you run concurrent jobs -- each is a
+ different thread. Within a job could be a feature, but *much* later.
+
+ > - parallel spooling (like parallel jobs/ concurrent jobs) of clients
+
+ Yes, this is one of my main motivations for doing it (aside from
+ eliminating tape "shoe shine" during incremental backups.
+
+ > - flushing a backup that only went to disk (like amflush in amanda)
+
+ This will be a future feature, since spooling is different from backing
+ up to disk. The future feature will be "migration" which will move a job
+ from one backup Volume to another.
+
- New Storage specifications:
- Want to write to multiple storage devices simultaneously
- Want to write to multiple storage devices sequentially (in one job)
is contained in only one device.
In SD allow Device to have Multiple MediaTypes
+After 1.33:
- Look at www.nu2.nu/pebuilder as a helper for full windows
bare metal restore.
-- Ideas from Jerry Scharf:
+Ideas from Jerry Scharf:
First let's point out some big pluses that bacula has for this
it's open source
more importantly it's active. Thank you so much for that
support for Oracle database ??
===
- Look at adding SQL server and Exchange support for Windows.
+- Restore: Enter Filename: 'C:/Documents and Settings/Comercial/My
+ Documents/MOP/formulário de registro BELAS ARTES.doc' causes Bacula to
+ crash.
- Each DVD-RAM disk would be a volume, just like each tape is
a volume. It's a 4.7GB media with random access, but there's nothing about
it that I can see that makes it so different than a tape from bacula's
be an invalid value which happens with BSR.
- Create VolAddr for disk files in place of VolFile and VolBlock. This
is needed to properly specify ranges.
+- Print bsmtp output to job report so that problems will be seen.
+- Pass the number of files to be restored to the FD for reporting
- Add progress of files/bytes to SD and FD.
+- Don't continue Restore if no files selected.
- Print warning message if FileId > 4 billion
- do a "messages" before the first prompt in Console
- Add a date and time stamp at the beginning of every line in the
Job report (Volker Sauer).
- Client does not show busy during Estimate command.
- Implement Console mtx commands.
+- Add a default DB password to MySQL.
+ GRANT all privileges ON bacula.* TO bacula@localhost IDENTIFIED BY
+ 'bacula_password';
+ FLUSH PRIVILEGES;
- Implement a Mount Command and an Unmount Command where
the users could specify a system command to be performed
to do the mount, after which Bacula could attempt to
- Implement dump/print label to UA
- Spool to disk only when the tape is full, then when a tape is hung move
it to tape.
+- Scratch Pool where the volumes can be re-assigned to any Pool.
- bextract is sending everything to the log file ****FIXME****
+- Add Progress command that periodically reports the progress of
+ a job or all jobs.
+- Restrict characters permitted in a Resource name, and don't permit
+ duplicate names.
- Allow multiple Storage specifications (or multiple names on
a single Storage specification) in the Job record. Thus a job
can be backed up to a number of storage devices.
- Implement some way for the File daemon to contact the Director
to start a job or pass its DHCP obtained IP number.
+- Implement multiple Consoles.
- Implement a query tape prompt/replace feature for a console
+- From Johan?
+ Two jobs ready to go, first one blocked waiting for media
+ Cancel 2nd job ("waiting execution" one)
+ Cancel blocked job
+ boom - segfault*
- Copy console @ code to gnome2-console
- Make AES the only encryption algorithm see
http://csrc.nist.gov/CryptoToolkit/aes/). It's
an officially adopted standard, has survived peer
review, and provides keys up to 256 bits.
+- Think about how space could be freed up on a tape -- perhaps this
+ is a Merge or Compact feature that is needed.
+- Modify FileSet, did not upgrade the current Increment job, but
+ waited for the next job to be upgraded.
- Take a careful look at SetACL http://setacl.sourceforge.net
+- Implement a where command for the tree telling where a file
+ is located.
- Take a careful look at Level for the estimate command, maybe make
it a command line option.
- Add Volume name to "I cannot write on this volume because"
- Make tree walk routines like cd, ls, ... more user friendly
by handling spaces better.
+- Write your PID file and chown root:wheel before drop.
+- Make sure there is no symlink in a file before creating a
+ file (attack).
+- Look at mktemp or mkstemp(3).
+ mktemp and mkstemp create files with predictable names too. That's
+ not the vulnerability. The vulnerability is in creating files without
+ using the O_EXCL flag, which means "only create this file if it doesn't
+ exist, including if the file is a dangling symlink."
+
+ It is *NOT* enough to do the equivalent of
+
+ if doesn't exist $filename
+ then create $filename
+
+ because between the test and the create another process could have
+ gotten the CPU and created the file. You must use atomic functions
+ (those that don't get interrupted by other processes) and O_EXCL is
+ the only way for this particular example.
+- Automatically create pools, but instead of looking for what
+ in in Job records, walk through the pool resources.
+- Check and double check tree code, why does it take so long?
+- Add device name to "Current Volume not acceptable because ..."
- Make sure that Bacula rechecks the tape after the 20 min wait.
- Set IO_NOWAIT on Bacula TCP/IP packets.
- Try doing a raw partition backup and restore by mounting a
By the way can bacula automatically "move" an empty/purged volume say
in the "short" pool to the "long" pool if this pool runs out of volume
space?
+- Eliminate orphaned jobs: dbcheck, normal pruning, delete job command.
+ Hm. Well, there are the remaining orphaned job records:
+
+ |  105 | Llioness Save | 0000-00-00 00:00:00 | B   | D    |       0 |            0 | f        |
+ |  110 | Llioness Save | 0000-00-00 00:00:00 | B   | I    |       0 |            0 | f        |
+ |  115 | Llioness Save | 2003-09-10 02:22:03 | B   | I    |       0 |            0 | A        |
+ |  128 | Catalog Save  | 2003-09-11 03:53:32 | B   | I    |       0 |            0 | C        |
+ |  131 | Catalog Save  | 0000-00-00 00:00:00 | B   | I    |       0 |            0 | f        |
+
+ As you can see, three of the five are failures. I already deleted the
+ one restore and one other failure using the by-client option. Deciding
+ what is an orphaned job is a tricky problem though, I agree. All these
+ records have or had 0 files/ 0 bytes, except for the restore. With no
+ files, of course, I don't know of the job ever actually becomes
+ associated with a Volume.
+
+ (I'm not sure if this is documented anywhere -- what are the meanings of
+ all the possible JobStatus codes?)
+
+ Looking at my database, it appears to me as though all the "orphaned"
+ jobs fit into one of two categories:
+
+ 1)Â The Job record has a StartTime but no EndTime, and the job is not
+ Â Â Â currently running;
+ or
+ 2)Â The Job record has an EndTime, indicating that it completed, but
+ Â Â Â it has no associated JobMedia record.
+
+
+ This does suggest an approach. If failed jobs (or jobs that, for some
+ other reason, write no files) are associated with a volume via a
+ JobMedia record, then they should be purged when the associated volume
+ is purged. I see two ways to handle jobs that are NOT associated with a
+ specific volume:
+
+ 1)Â purge them automatically whenever any volume is manually purged;
+ or
+ 2)Â add an option to the purge command to manually purge all jobs with
+ Â Â Â no associated volume.
+
+ I think Restore jobs also fall into category 2 above .... so one might
+ want to make that "The Job record has an EndTime,, but no associated
+ JobMedia record, and is not a Restore job."
+- make "btape /tmp" work.
+- Make sure a rescheduled job is properly reported by status.
+- Walk through the Pool records rather than the Job records
+ in dird.c to create/update pools.
- What to do about "list files job=xxx".
+- When job rescheduled, status gives is waiting for Client Rufus
+ to connect to Storage File. Dir needs to inform SD that job
+ is rescheduled.
- Make Dmsg look at global before calling subroutine.
+- Enable trace output at runtime for Win32
+- Available volumes for autochangers (see patrick@baanboard.com 3 Sep 03
+ and 4 Sep) scan slots.
- Get and test MySQL 4.0
+- Do a complete audit of all pthreads_mutex, cond, ... to ensure that
+ any that are dynamically initialized are destroyed when no longer used.
- Look at how fuser works and /proc/PID/fd that is how Nic found the
file descriptor leak in Bacula.
- Implement WrapCounters in Counters.
+- Turn on SIGHUP in dird.c and test.
+- Use system dependent calls to get more precise info on tape errors.
- Add heartbeat from FD to SD if hb interval expires.
+- Suppress read error on blank tape when doing a label.
- Can we dynamically change FileSets?
- If pool specified to label command and Label Format is specified,
automatically generate the Volume name.
- Why can't SQL do the filename sort for restore?
+- Look at libkse (man kse) for FreeBSD threading.
- Look into Microsoft Volume Shadowcopy Service VSS for backing
up system state components (Active Directory, System Volume, ...)
- Add ExhautiveRestoreSearch
data into the restore tree (i.e. do it one directory at a
time as the user walks through the tree).
- Possibly use the hash code if the user selects all for a restore command.
+- Orphaned Dir buffer at parse_conf.c:373 => store_dir
- Fix "restore all" to bypass building the tree.
- Prohibit backing up archive device (findlib/find_one.c:128)
- Implement Release Device in the Job resource to unmount a drive.
be sure this works with admin jobs so that the user can get
prompted to insert the correct tape. Possibly some way to say to
run the job but don't save the files.
+- Implement FileOptions (see end of this document)
- Make things like list where a file is saved case independent for
Windows.
- Implement migrate
+- Bacula needs to propagate SD errors.
+ > > cluster-dir: Start Backup JobId 252, Job=REUTERS.2003-08-11_15.04.12
+ > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Write error on device
+ /dev/nst0. ERR=Input/output error.
+ > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Re-read of last block failed.
+ Last block=5162 Current block=5164.
+ > > prod4-sd: End of medium on Volume "REU007" Bytes=16,303,521,933
+
- Use autochanger to handle multiple devices.
- Add SuSE install doc to list.
- Check and rechedk "Invalid block number"
+- Make bextract release the drive properly between tapes
+ so that an autochanger can be made to work.
- User wants to NOT backup up certain big files (email files).
- Maybe remove multiple simultaneous devices code in SD.
- On Windows with very long path names, it may be impossible to create
a file (and thus restore it) because the total length is too long.
We must cd into the directory then create the file without the
full path name.
+- lstat() is not going to work on Win32 for testing date.
- Implement a Recycle command
- Add client name to cram-md5 challenge so Director can immediately
verify if it is the correct client.
+- Add JobLevel in FD status (but make sure it is defined).
- Audit all UA commands to ensure that we always prompt where possible.
+- Check Jmsg in bnet, may not work, must dup bsock.
+- Suppress Job Name in Jmsg for console
+- Create Pools that are referenced in a Run statement at startup if possible.
+- Use runbeforejob to unload, then reload a volume previously used,
+ then the next job run gets an error reading the drive.
- Make bootstrap filename unique.
- Test a second language e.g. french.
- Start working on Base jobs.
+- Make "make binary-release" work from any directory.
- Implement UnsavedFiles DB record.
- Implement argc/argv for daemon command line scanning using table driven
stuff below.
+- Implement table driven single argc/argv scanner to pickup all arguments.
+ Much like xxx_conf.c scan table.
+ keyword, handler(store_routine), store_address, code, flags, default.
- From Phil Stracchino:
It would probably be a per-client option, and would be called
something like, say, "Automatically purge obsoleted jobs". What it
- Currently in mount.c:236 the SD simply creates a Volume. It should have
explicit permission to do so. It should also mark the tape in error
if there is an error.
+- Make sure all restore counters are working correctly in the FD.
- SD Bytes Read is wrong.
+- Look at ALL higher level routines that call block.c to be sure
+ they don't expect something in errmsg.
- Investigate doing RAW backup of Win32 partition.
+- Add thread specific data to hold the jcr -- send error messages from
+ low level routines by accessing it and using Jmsg().
- Cancel waiting for Client connect in SD if FD goes away.
+- Examine Bare Metal restore problem (a FD crash exists somewhere ...).
- Implement timeout in response() when it should come quickly.
- Implement console @echo command.
- Implement a Slot priority (loaded/not loaded).
- Implement single pane restore (much like the Gftp panes).
- Implement Automatic Mount even in operator wait.
- Implement create "FileSet"?
+- Fix watchdog pthread crash on Win32 (this is pthread_kill() Cygwin bug)
+- Implement "scratch pool" where tapes are defined and can be
+ taken by any pool that needs them.
- Implement restore "current system", but take all files without
doing selection tree -- so that jobs without File records can
be restored.
- Figure out how to do a bare metal Windows restore
- Possibly add email to Watchdog if drive is unmounted too
long and a job is waiting on the drive.
+- Restore program that errs in SD due to no tape, reports
+ OK incorrectly in output.
- After unmount, if restore job started, ask to mount.
- Convert all %x substitution variables, which are hard to remember
and read to %(variable-name). Idea from TMDA.
====
-=== Done
-- Add "Rerun failed levels = yes/no" to Job resource.
-- Fix CDROM make script to permit picking up already installed
- static FD.
-- Add date/time to each Jmsg.
+=== Done in 1.34.3
+- To pass Include 1 or two letter commands
+ I Name Include name - first record
+ B Name Base name - repeat
+ R "xxx" Regexp
+ W "xxx" Wild Card
+ E zzz Exclude expression (wild card)
+ P "plugin" Plugin
+ D "reader" Reader program
+ T "writer" Writer program
+ O Options In current commpressed format
+ (compression, signature, onefs, recurse, sparse,
+ replace, verify options, ...)
+ N End option set
+ B BaseName Start second option set any letter
+ ...
+ E
+ F Number Number of filenames to follow
+ <file-name>
+ B Name
+ ...
+ N End option set
+ F Number Number of filenames to follow
+ <file-name>
+ ...
+- Add regression of btape "fill"
+==== Done in 1.34.4
+- Implement "label slots=1,2... pool=yyy barcodes"
+- Mark a non-removable disk Volume in error rather than asking sys op to
+ mount it.
+- Implement Fixed storage LabelFormat test.
+- Add reporting in attr despooling.
+- Figure out how to use ssh or stunnel to protect Bacula communications.
+ Add Dan's work to manual See ssl.txt
+
+==== Done in 1.35.0
+- Implement fast tree insert (doubly linked list)
+- Disallow using Internal database
+- Feedback while the restore tree is being built.
+- Add detection of Whitebox release in ./configure
+- Add InChanger to "list media"
+- Implement second cut of SIGHUP in Dir
+ (Implement resources on a single pointer)
+- Add regular expressions to FileSets (needs testing).
+- Test new despooling error recovery code when partition fills.
+- Sort Scheduled jobs status listing by start time.
+- Add priority to Scheduled jobs status listing.
+- Look at Win32 inc problem when new directory added files not saved???
+- Require resource names to be unique.
+- Make sure that all errors from libacl are printed.
+- Make FD run on Win95 if possible (not really possible).
+- Fix GROUP BYs in all SQL (done by Dan -- thanks)
+- Make entering multiple Storage names in Dir illegal.
+- Make btape release the drive during the "test" append.
+- Fix restore:
+ You have selected the following JobIds: 739,856,797
+ Building directory tree for JobId 739 ...
+ Building directory tree for JobId 856 ...
+ Building directory tree for JobId 797 ...3
+ Jobs inserted into the tree.
+- Fix errno handling in win32 compat routines.
+- Add better error codes to run_program (10000+)
+- Revisit and revise Disaster Recovery (fix SCSI and RAID
+ disk detection)
+- When passwords do not match, print message that points the
+ user to the doc.
+- Do tape alerts -- see tapealert.txt
+- Find memory leaks in address_conf.c
+- Network order of port and ip addresses.
+- SetIP in dird/fd_cmds.c is broken.
+- don't use inet_addr() it is deprecated.
+- Fix code in filed.c for init_bsock();
+- Fix code in console.c for init_bsock();
+- Solve the termcap.h problem on Solaris configure.
+- Make Verify jobs require exclusive use of Volume as Restore
+ jobs do.
+- Fix restore ++++ that get intermingled with "Building directory tree"
+- Fix doc in dirdconf.html for @, where the file must
+ have not a list of files, but
+ file = xxx
+ file = yyy
+- Test Win32 errno handling.
+- port 1.34.6-block.patch to 1.35
+- Look at Chris' patch for bscan bug.
+- Fix error handling in spooling both data and attribute.
+- Implement Ignore FileSet Change.
+- Doc new duration time input editing.
+- Bacula rescue CDROM implement isolinux
+- Make sure Qmsgs are dequeued by FD and SD.
+- Check if ACLs allocated at dird_conf.c:1214 are being properly
+ released.
+- Test/doc Tape Alerts
+- Doc dbcheck eliminate orphaned clients.
+- Doc Phil's new delete job jobid scanning code.
+- Document that console commands can be abbreviated.
+- Doc update AllFromVol
+- Doc -p option in stored
+- New IP address specification is used as follows:
+ [sdaddresses|diraddresses|fdaddresses] = { [[ip|ipv4|ipv6] = {
+ [[addr|port] = [^ ]+[\n;]+] }] }
+
+ so it could look for example like this:
+ SDaddresses = { ip = {
+ addr = 1.2.3.4; port = 1205; }
+ ipv4 = {
+ addr = 1.2.3.4; port = http; }
+ ipv6 = {
+ addr = 1.2.3.4;
+ port = 1205;
+ }
+ ip = {
+ addr = 1.2.3.4
+ port = 1205
+ }
+ ip = {
+ addr = 1.2.3.4
+ }
+ ip = {
+ addr = 201:220:222::2
+ }
+ ip = {
+ addr = bluedot.thun.net
+ }
+ }
+ as a consequence, you can now specify multiple IP addresses and
+ ports to be used. In the case of a server, it will listen on
+ all those that you specify. In the case of connecting to the server,
+ Bacula will attempt connecting to one at a time until it succeeds.
+ And, in a few other special cases, Bacula will use only the first
+ address specified.
+
+ The default port numbers are still the same and the services and hosts
+ are also resolved by name. So now you could use the real names for the
+ port numbers.
+
+ An ip section will allow resolution to either an ipv4 or an ipv6 address.
+ An ipv4 section forces the resolution to be only ipv4, and an ipv6 section
+ forces the resolution to be only ipv6.
+- Fix silly restriction requiring Include { Options { xxx } } to be
+ on separate lines.
+- Restore c: with a prefix into /prefix/c/ to prevent c: and d:
+ files with the same name from overwritting each other.
+- Add "Multiple connections = yes/no" to catalog resource.
+- Add new DCR calling sequences everywhere in SD. This will permit
+ simultaneous use of multiple devices by a single job.
+- Fix bscan so that it releases the drive when requesting a new tape.
+- List verify options for DiskToCatalog in doc.
+- Turn on transactions if multiple connections are on in DB.
+- Fix storage overrides in Run directives.
+- Look into failing Excludes in Win32
+- Make restore check if the file size restored is correct.
+- Backspace to beginning of line (conio) does not erase first char.
+- Fix possible bug in update volumefrompool (email 9/28 from
+ jesk@killall.org
+- Add relabel regression test.
+- Document a get out of jail procedure if everything breaks if
+ you lost/broke the Catalog -- do the same for "I know my
+ file is there how do I get it back?".
+- Fix documentation for readline.
+- Add File indexes as suggested by Martin -- modify update
+ scripts to add them.
+- Modify postgresql update script to remove bigint FilenameId
+ reference.
+- Kill daemons at levels in the teens rather than late.
+++ /dev/null
-#!/bin/sh
-#
-# Shell script to fix PostgreSQL tables in version 8
-#
-echo " "
-echo "This script will fix a Bacula PostgreSQL database version 8"
-echo "Depending on the size of your database,"
-echo "this script may take several minutes to run."
-echo " "
-#
-# Set the following to the path to psql.
-bindir=****EDIT-ME to be the path to psql****
-
-if $bindir/psql $* -f - <<END-OF-DATA
-\c bacula
-
-begin;
-
-alter table media rename column endblock to endblock_old;
-alter table media add column endblock bigint;
-update media set endblock = endblock_old;
-alter table media alter column endblock set not null;
-alter table media drop column endblock_old;
-
-commit;
-
-vacuum;
-
-END-OF-DATA
-then
- echo "Update of Bacula PostgreSQL tables succeeded."
-else
- echo "Update of Bacula PostgreSQL tables failed."
-fi
-exit 0
--- /dev/null
+diff -uNr bacula-1.36.2/configure bacula-1.36.2-fixed/configure
+--- bacula-1.36.2/configure 2005-02-25 04:46:49.000000000 -0500
++++ bacula-1.36.2-fixed/configure 2005-03-06 10:11:23.905848861 -0500
+@@ -7301,15 +7301,6 @@
+ # get scsibus,target,lun
+ # -------------------------------------------
+ CDSTL="3,0,0"
+-if test ! x$CDRECORD = x ; then
+- CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD-RW | ${AWK} '{print $1}'`
+- if test x${CDSTL} = x ; then
+- CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD+RW | ${AWK} '{print $1}'`
+- fi
+- if test x${CDSTL} = x ; then
+- CDSTL="3,0,0"
+- fi
+-fi
+
+
+
# Copyright 2004 D. Scott Barninger
-# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+#
# Modified from bacula-1.34.5.ebuild for 1.36.0 release
# 24 Oct 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# added cdrom rescue for 1.36.1
+# init script now comes from source package not ${FILES} dir
+# 26 Nov 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# fix symlink creation in rescue package in post script
+# remove mask on x86 keyword
+# fix post script so it doesn't talk about server config for client-only build
+# bug #181 - unable to reproduce on 2.4 kernel system so add FEATURES="-sandbox"
+# 04 Dec 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# more on bug #181 - another user has reported a sandbox violation trying to
+# write to /dev/sg0 - still can't reproduce this behavior
+# add an 'addpredict /dev/sg0'
+# 08 Dec 2004 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# resolve bug #181 - problem is caused by configure calling cdrecord to scan
+# the scsi bus. patch configure to remove this. add logrotate script.
+# 06 Feb 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# fix documentation bug
+# 07 Feb 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# new USE keywords bacula-clientonly bacula-split
+# add new logwatch scripts
+# 06 Mar 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
+#
+# 1.36.3 doc changes
+# 17 Apr 2005 D. Scott Barninger <barninger at fairfieldcomputers dot com>
DESCRIPTION="featureful client/server network backup suite"
HOMEPAGE="http://www.bacula.org/"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~x86 ~ppc ~sparc"
-IUSE="readline tcpd gnome mysql sqlite X static postgres wxwindows"
+KEYWORDS="x86 ~ppc ~sparc ~amd64"
+IUSE="readline tcpd gnome mysql sqlite X static postgres wxwindows bacula-clientonly bacula-split"
inherit eutils
-#theres a local sqlite use flag. use it -OR- mysql, not both.
-#mysql is the reccomended choice ...
-#may need sys-libs/libtermcap-compat but try without first
+# there is a local sqlite use flag. use it -OR- mysql, not both.
+# mysql is the recommended choice ...
+# may need sys-libs/libtermcap-compat but try without first
DEPEND=">=sys-libs/zlib-1.1.4
- sys-apps/mtx
readline? ( >=sys-libs/readline-4.1 )
tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
gnome? ( gnome-base/libgnome )
gnome? ( app-admin/gnomesu )
- sqlite? ( =dev-db/sqlite-2* )
- mysql? ( >=dev-db/mysql-3.23 )
- postgres? ( >=dev-db/postgresql-7.4.0 )
+ !bacula-clientonly? (
+ sqlite? ( =dev-db/sqlite-2* )
+ mysql? ( >=dev-db/mysql-3.23 )
+ postgres? ( >=dev-db/postgresql-7.4.0 )
+ sys-apps/mtx
+ )
X? ( virtual/x11 )
wxwindows? ( >=x11-libs/wxGTK-2.4.2 )
virtual/mta
- dev-libs/gmp"
+ dev-libs/gmp
+ app-text/tetex
+ dev-tex/latex2html"
RDEPEND="${DEPEND}
- sys-apps/mtx
- app-arch/mt-st"
+ !bacula-clientonly? (
+ sys-apps/mtx
+ app-arch/mt-st
+ )"
src_compile() {
- # patch configure for scripts/bacula-tray-monitor.desktop
- patch ${S}/configure ${FILESDIR}/${P}-configure.diff
+ # this resolves bug #181
+ epatch ${FILESDIR}/1.36.2-cdrecord-configure.patch
local myconf=""
- #sed -i -e "s:$bindir/mysql:$bindir/mysql -p:g" grant_mysql_privileges.in
-
- #define this to skip building the other daemons ...
- [ -n "$BUILD_CLIENT_ONLY" ] \
- && myconf="${myconf} --enable-client-only"
-
myconf="
`use_enable readline`
`use_enable gnome`
`use_enable tcpd tcp-wrappers`
`use_enable X x`"
- [ -n "$BUILD_CLIENT_ONLY" ] \
- && myconf="${myconf} --enable-client-only"
-
- # mysql is the reccomended choice ...
- if use mysql
- then
- myconf="${myconf} --with-mysql=/usr"
- elif use postgres
+ # define this to skip building the other daemons ...
+ if use bacula-clientonly
then
- myconf="${myconf} --with-postgresql=/usr"
- elif use sqlite
- then
- myconf="${myconf} --with-sqlite=/usr"
- elif use sqlite && use mysql
+ myconf="${myconf} --enable-client-only"
+ fi
+
+ # select database support
+ if ! use bacula-clientonly
then
- myconf="${myconf/--with-sqlite/}"
+ # mysql is the recomended choice ...
+ if use mysql
+ then
+ myconf="${myconf} --with-mysql=/usr"
+ elif use postgres
+ then
+ myconf="${myconf} --with-postgresql=/usr"
+ elif use sqlite
+ then
+ myconf="${myconf} --with-sqlite=/usr"
+ elif use sqlite && use mysql
+ then
+ myconf="${myconf/--with-sqlite/}"
+ fi
fi
if use wxwindows
myconf="${myconf} --enable-tray-monitor"
fi
-
./configure \
--enable-smartalloc \
--prefix=/usr \
emake || die "compile problem"
+ # for the rescue package regardless of use static
+ cd ${S}/src/filed
+ make static-bacula-fd
+ cd ${S}
+
+ # make the docs
+ cd ${S}/doc/latex
+ make
+ cd ${S}
+
if use static
then
- cd ${S}/src/filed
- make static-baula-fd
cd ${S}/src/console
make static-console
cd ${S}/src/dird
cd ${S}/src/wx-console
cp static-wx-console ${D}/usr/sbin/wx-console
fi
- cd ${S}/src/storge
+ cd ${S}/src/stored
cp static-bacula-sd ${D}/usr/sbin/bacula-sd
fi
chmod 644 ${D}/etc/bacula/tray-monitor.conf
fi
- # the database update scripts
- mkdir -p ${D}/etc/bacula/updatedb
- cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/
- chmod 754 ${D}/etc/bacula/updatedb/*
+ if ! use bacula-clientonly
+ then
+ # the database update scripts
+ mkdir -p ${D}/etc/bacula/updatedb
+ cp ${S}/updatedb/* ${D}/etc/bacula/updatedb/
+ chmod 754 ${D}/etc/bacula/updatedb/*
+
+ # the logrotate configuration
+ mkdir -p ${D}/etc/logrotate.d
+ cp ${S}/scripts/logrotate ${D}/etc/logrotate.d/bacula
+ chmod 644 ${D}/etc/logrotate.d/bacula
+
+ # the logwatch scripts
+ mkdir -p ${D}/etc/log.d/conf/logfiles
+ mkdir -p ${D}/etc/log.d/conf/services
+ mkdir -p ${D}/etc/log.d/scripts/services
+ cp ${S}/scripts/logwatch/bacula ${D}/etc/log.d/scripts/services/bacula
+ cp ${S}/scripts/logwatch/logfile.bacula.conf ${D}/etc/log.d/conf/logfiles/bacula.conf
+ cp ${S}/scripts/logwatch/services.bacula.conf ${D}/etc/log.d/conf/services/bacula.conf
+ chmod 755 ${D}/etc/log.d/scripts/services/bacula
+ chmod 644 ${D}/etc/log.d/conf/logfiles/bacula.conf
+ chmod 644 ${D}/etc/log.d/conf/services/bacula.conf
+
+ fi
+
+ # the cdrom rescue package
+ mkdir -p ${D}/etc/bacula/rescue/cdrom
+ cp -R ${S}/rescue/linux/cdrom/* ${D}/etc/bacula/rescue/cdrom/
+ mkdir ${D}/etc/bacula/rescue/cdrom/bin
+ cp ${S}/src/filed/static-bacula-fd ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd
+ chmod 754 ${D}/etc/bacula/rescue/cdrom/bin/bacula-fd
# documentation
- for a in ${S}/{Changelog,README,ReleaseNotes,kernstodo,LICENSE,doc/bacula.pdf}
+ for a in ${S}/{ChangeLog,README,ReleaseNotes,kernstodo,LICENSE,doc/latex/bacula.pdf}
do
dodoc $a
done
- dohtml -r ${S}/doc/html-manual doc/home-page
- chown -R root:root ${D}/usr/share/doc/${PF}
- chmod -R 644 ${D}/usr/share/doc/${PF}/*
+ dohtml -r ${S}/doc/latex/bacula
# clean up permissions left broken by install
chmod o-r ${D}/etc/bacula/query.sql
# remove the working dir so we can add it postinst with group
rmdir ${D}/var/bacula
+ # init scripts
exeinto /etc/init.d
- newexe ${FILESDIR}/bacula-init bacula
+ if use bacula-clientonly
+ then
+ newexe ${S}/platforms/gentoo/bacula-fd bacula-fd
+ else
+ if use bacula-split
+ then
+ newexe ${S}/platforms/gentoo/bacula-fd bacula-fd
+ newexe ${S}/platforms/gentoo/bacula-sd bacula-sd
+ newexe ${S}/platforms/gentoo/bacula-dir bacula-dir
+ else
+ newexe ${S}/platforms/gentoo/bacula-init bacula
+ fi
+ fi
}
pkg_postinst() {
# the working directory
install -m0750 -o root -g bacula -d ${ROOT}/var/bacula
+ # link installed bacula-fd.conf into rescue directory
+ #ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bacula-fd.conf
+ # no longer necessary after 1.36.2
+
+ einfo
+ einfo "The CDRom rescue disk package has been installed into the"
+ einfo "/etc/bacula/rescue/cdrom/ directory. Please examine the manual"
+ einfo "for information on creating a rescue CD. CDR device detection"
+ einfo "during build has been disabled to prevent sandbox violations."
+ einfo "You need to examine /etc/bacula/rescue/cdrom/Makefile and adjust"
+ einfo "the device information for your CD recorder."
+ einfo
+
+ if ! use bacula-clientonly; then
einfo
einfo "Please note either/or nature of database USE flags for"
- einfo "Bacula. If mysql is set, it will be used, else postgresql"
+ einfo "Bacula. If mysql is set, it will be used, else postgres"
einfo "else finally SQLite. If you wish to have multiple DBs on"
einfo "one system, you may wish to unset auxillary DBs for this"
einfo "build."
then
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
- DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
if [ -z "$DB_VER" ]; then
einfo "This appears to be a new install and you plan to use mysql"
einfo "for your catalog database. You should now create it by doing"
fi
fi
- if use postgresql
+ if use postgres
then
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
- DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+ DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
if [ -z "$DB_VER" ]; then
einfo "This appears to be a new install and you plan to use postgresql"
einfo "for your catalog database. You should now create it by doing"
einfo "these commands:"
- einfo " sh /etc/bacula/grant_postgresql_privileges"
einfo " sh /etc/bacula/create_postgresql_database"
einfo " sh /etc/bacula/make_postgresql_tables"
+ einfo " sh /etc/bacula/grant_postgresql_privileges"
elif [ "$DB_VER" -lt "8" ]; then
elinfo "This release requires an upgrade to your bacula database"
einfo "as the database format has changed. Please read the"
then
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
- DB_VER=`echo "select * from Version;" | sqlite /var/bacula/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | sqlite 2>/dev/null /var/bacula/bacula.db | tail -n 1`
if [ -z "$DB_VER" ]; then
einfo "This appears to be a new install and you plan to use sqlite"
einfo "for your catalog database. You should now create it by doing"
einfo "manual chapter for how to upgrade your database!!!"
einfo
einfo "Backup your database with the command:"
- einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \"
+ einfo " echo .dump | sqlite /var/bacula/bacula.db | bzip2 > \\"
einfo " /var/bacula/bacula_backup.sql.bz2"
einfo
einfo "Then update your database using the scripts found in"
einfo "version to the current version."
fi
fi
+ fi
einfo
- einfo "Then setup your configuration files in /etc/bacula and"
+ einfo "Review your configuration files in /etc/bacula and"
einfo "start the daemons:"
- einfo " /etc/init.d/bacula start"
+ if use bacula-clientonly; then
+ einfo " /etc/init.d/bacula-fd start"
+ else
+ if use bacula-split; then
+ einfo " /etc/init.d/bacula-sd start"
+ einfo " /etc/init.d/bacula-dir start"
+ einfo " /etc/init.d/bacula-fd start"
+ einfo " or /etc/bacula/bacula will start all three."
+ else
+ einfo " /etc/init.d/bacula start"
+ fi
+ fi
einfo
einfo "You may also wish to:"
- einfo " rc-update add bacula default"
+ if use bacula-clientonly; then
+ einfo " rc-update add bacula-fd default"
+ else
+ if use bacula-split; then
+ einfo " rc-update add bacula-sd default"
+ einfo " rc-update add bacula-dir default"
+ einfo " rc-update add bacula-fd default"
+ else
+ einfo " rc-update add bacula default"
+ fi
+ fi
einfo
}
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
# Platform Build Configuration
# basic defines for every build
%{?build_rh8:%define rh8 1}
%define rh9 0
%{?build_rh9:%define rh9 1}
-# Fedora Core 1 build
+# Fedora Core build
%define fc1 0
%{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
# Whitebox Enterprise build
-# this should also work for RHEL
%define wb3 0
%{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
# SuSE build
-# this is known to build on SuSE 8.2 and 9.0
%define su9 0
%{?build_su9:%define su9 1}
# Mandrake build
%{?build_mdk:%define mdk 1}
# test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
%{error: You must specify a platform. Please examine the spec file.}
exit 1
%endif
# set for database support desired or define the build_xxx on the command line
%define mysql 0
%{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
%define sqlite 0
%{?build_sqlite:%define sqlite 1}
%define postgresql 0
exit 1
%endif
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
Summary: Bacula - The Network Backup Solution
Name: bacula
Version: @VERSION@
BuildRoot: %{_tmppath}/%{name}-root
URL: http://www.bacula.org/
Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
%if %{rh7}
BuildRequires: libtermcap-devel
BuildRequires: bonobo-devel
BuildRequires: GConf-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
%if %{su9}
BuildRequires: termcap
BuildRequires: gconf2-devel
BuildRequires: linc-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
%if %{mdk}
BuildRequires: libtermcap-devel
BuildRequires: libstdc++-static-devel
BuildRequires: glibc-static-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
BuildRequires: libtermcap-devel
BuildRequires: gtk2-devel >= 2.0
BuildRequires: libgnomeui-devel >= 2.0
BuildRequires: GConf2-devel
BuildRequires: linc-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
BuildRequires: mysql-devel >= 3.23
%endif
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
BuildRequires: rh-postgresql-devel >= 7
%endif
%if %{sqlite}
Conflicts: sqlite, sqlite-tools
%endif
+
%if %{rh7}
Requires: glibc >= 2.2
Requires: libtermcap
Requires: glibc >= 2.3
Requires: libtermcap
%endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-server >= 3.23
%endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
Requires: rh-postgresql >= 7
Requires: rh-postgresql-server >= 7
Summary: Bacula - The Network Backup Solution
Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
%description rescue
Bacula - It comes by night and sucks the vital essence from your computers.
Bacula source code has been released under the GPL version 2 license.
This package installs scripts for disaster recovery and builds rescue
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
(http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
to build a boot floppy disk.
bacula-client package for your platform installed and configured before
installing this package.
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
directory (this is done when the package is first installed),
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
directory. To make the bacula rescue disk run
"./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
information for this system run ./getdiskinfo again.
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile. To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
%package updatedb
Summary: Bacula - The Network Backup Solution
Requires: GConf2
Requires: freetype2
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
Requires: gtk2 >= 2.0
Requires: libgnomeui >= 2.0
Requires: glibc >= 2.3
patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
%endif
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
%configure \
--prefix=/usr \
--sbindir=/usr/sbin \
strip static-bacula-fd
cd ../../
+cd doc/latex
+make
+cd ../../
+
%install
cwd=${PWD}
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
%if %{rh7}
mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
mtx-install
cd ${cwd}
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
# fixme - make installs the mysql scripts for sqlite build
%if %{sqlite}
cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
%endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
# install the updatedb scripts
cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
# now clean up permissions that are left broken by the install
chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
chmod o-rwx $RPM_BUILD_ROOT/var/bacula
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre mysql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%{sqlite_bindir}/libsqlite.a
%{sqlite_bindir}/sqlite.h
%pre sqlite
# test for bacula database older than version 7
if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
echo "You appear to be running database version $DB_VER. You must first update"
# test for an existing database
if [ -s %{working_dir}/bacula.db ]; then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
# check to see if we need to upgrade a 1.34 or lower database
if [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade requires a database update to version 8. You appear to"
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre postgresql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
echo "Hmm, doesn't look like you have an existing database."
- echo "Granting privileges for PostgreSQL user bacula..."
- /etc/bacula/grant_postgresql_privileges
echo "Creating PostgreSQL bacula database..."
/etc/bacula/create_postgresql_database
echo "Creating bacula tables..."
/etc/bacula/make_postgresql_tables
+ echo "Granting privileges for PostgreSQL user bacula..."
+ /etc/bacula/grant_postgresql_privileges
# check to see if we need to upgrade a 1.34 or lower database
elif [ "$DB_VER" -lt "8" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
echo "The group %{daemon_group} has been added to %{groupfile}."
/etc/bacula/bconsole
/etc/init.d/bacula-fd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/etc/logrotate.d/bacula
%config(noreplace) /etc/bacula/bacula-fd.conf
HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
%post rescue
# link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
# run getdiskinfo
echo "Creating rescue files for this system..."
%if ! %{rh7} && ! %{rh8}
/usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
/usr/share/pixmaps/bacula-tray-monitor.xpm
/usr/share/applications/bacula-tray-monitor.desktop
%endif
%changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives,
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
* Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
- update depkgs to 29Oct04
* Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
if [ "${DIR_GROUP}" != '' ]; then
OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
fi
- echo -n "Starting the Bacula Director: "
+ echo -n "Starting Bacula Director services: "
daemon @sbindir@/bacula-dir $2 ${OPTIONS} -c @sysconfdir@/bacula-dir.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-dir
;;
stop)
- echo -n "Stopping the Director daemon: "
+ echo -n "Stopping Bacula Director services: "
killproc @sbindir@/bacula-dir
RETVAL=$?
echo
if [ "${FD_GROUP}" != '' ]; then
OPTIONS="${OPTIONS} -g ${FD_GROUP}"
fi
- echo -n "Starting the Bacula File daemon: "
+ echo -n "Starting Bacula File services: "
daemon @sbindir@/bacula-fd $2 ${OPTIONS} -c @sysconfdir@/bacula-fd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
;;
stop)
- echo -n "Stopping the Bacula File daemon: "
+ echo -n "Stopping Bacula File services: "
killproc @sbindir@/bacula-fd
RETVAL=$?
echo
OPTIONS="${OPTIONS} -g ${SD_GROUP}"
fi
- echo -n "Starting the Bacula Storage daemon: "
+ echo -n "Starting Bacula Storage services: "
daemon @sbindir@/bacula-sd $2 ${OPTIONS} -c @sysconfdir@/bacula-sd.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd
;;
stop)
- echo -n "Stopping the Bacula Storage daemon: "
+ echo -n "Stopping Bacula Storage services: "
killproc @sbindir@/bacula-sd
RETVAL=$?
echo
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
# Platform Build Configuration
# basic defines for every build
%{?build_rh8:%define rh8 1}
%define rh9 0
%{?build_rh9:%define rh9 1}
-# Fedora Core 1 build
+# Fedora Core build
%define fc1 0
%{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
# Whitebox Enterprise build
-# this should also work for RHEL
%define wb3 0
%{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
# SuSE build
-# this is known to build on SuSE 8.2 and 9.0
%define su9 0
%{?build_su9:%define su9 1}
# Mandrake build
%{?build_mdk:%define mdk 1}
# test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
%{error: You must specify a platform. Please examine the spec file.}
exit 1
%endif
# set for database support desired or define the build_xxx on the command line
%define mysql 0
%{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
%define sqlite 0
%{?build_sqlite:%define sqlite 1}
%define postgresql 0
exit 1
%endif
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
Summary: Bacula - The Network Backup Solution
Name: bacula
Version: @VERSION@
BuildRoot: %{_tmppath}/%{name}-root
URL: http://www.bacula.org/
Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
%if %{rh7}
BuildRequires: libtermcap-devel
BuildRequires: bonobo-devel
BuildRequires: GConf-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
%if %{su9}
BuildRequires: termcap
BuildRequires: gconf2-devel
BuildRequires: linc-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
%if %{mdk}
BuildRequires: libtermcap-devel
BuildRequires: libstdc++-static-devel
BuildRequires: glibc-static-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
BuildRequires: libtermcap-devel
BuildRequires: gtk2-devel >= 2.0
BuildRequires: libgnomeui-devel >= 2.0
BuildRequires: GConf2-devel
BuildRequires: linc-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
BuildRequires: mysql-devel >= 3.23
%endif
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
BuildRequires: rh-postgresql-devel >= 7
%endif
%if %{sqlite}
Conflicts: sqlite, sqlite-tools
%endif
+
%if %{rh7}
Requires: glibc >= 2.2
Requires: libtermcap
Requires: glibc >= 2.3
Requires: libtermcap
%endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-server >= 3.23
%endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
Requires: rh-postgresql >= 7
Requires: rh-postgresql-server >= 7
Summary: Bacula - The Network Backup Solution
Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
%description rescue
Bacula - It comes by night and sucks the vital essence from your computers.
Bacula source code has been released under the GPL version 2 license.
This package installs scripts for disaster recovery and builds rescue
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
(http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
to build a boot floppy disk.
bacula-client package for your platform installed and configured before
installing this package.
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
directory (this is done when the package is first installed),
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
directory. To make the bacula rescue disk run
"./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
information for this system run ./getdiskinfo again.
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile. To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
%package updatedb
Summary: Bacula - The Network Backup Solution
Requires: GConf2
Requires: freetype2
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
Requires: gtk2 >= 2.0
Requires: libgnomeui >= 2.0
Requires: glibc >= 2.3
patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
%endif
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
%configure \
--prefix=/usr \
--sbindir=/usr/sbin \
strip static-bacula-fd
cd ../../
+cd doc/latex
+make
+cd ../../
+
%install
cwd=${PWD}
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
%if %{rh7}
mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
mtx-install
cd ${cwd}
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
# fixme - make installs the mysql scripts for sqlite build
%if %{sqlite}
cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
%endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
# install the updatedb scripts
cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
# now clean up permissions that are left broken by the install
chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
chmod o-rwx $RPM_BUILD_ROOT/var/bacula
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre mysql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%{sqlite_bindir}/libsqlite.a
%{sqlite_bindir}/sqlite.h
%pre sqlite
# test for bacula database older than version 7
if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
echo "You appear to be running database version $DB_VER. You must first update"
# test for an existing database
if [ -s %{working_dir}/bacula.db ]; then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
# check to see if we need to upgrade a 1.34 or lower database
if [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade requires a database update to version 8. You appear to"
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre postgresql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
echo "Hmm, doesn't look like you have an existing database."
- echo "Granting privileges for PostgreSQL user bacula..."
- /etc/bacula/grant_postgresql_privileges
echo "Creating PostgreSQL bacula database..."
/etc/bacula/create_postgresql_database
echo "Creating bacula tables..."
/etc/bacula/make_postgresql_tables
+ echo "Granting privileges for PostgreSQL user bacula..."
+ /etc/bacula/grant_postgresql_privileges
# check to see if we need to upgrade a 1.34 or lower database
elif [ "$DB_VER" -lt "8" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
echo "The group %{daemon_group} has been added to %{groupfile}."
/etc/bacula/bconsole
/etc/init.d/bacula-fd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/etc/logrotate.d/bacula
%config(noreplace) /etc/bacula/bacula-fd.conf
HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
%post rescue
# link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
# run getdiskinfo
echo "Creating rescue files for this system..."
%if ! %{rh7} && ! %{rh8}
/usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
/usr/share/pixmaps/bacula-tray-monitor.xpm
/usr/share/applications/bacula-tray-monitor.desktop
%endif
%changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives,
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
* Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
- update depkgs to 29Oct04
* Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
install-autostart-fd:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-fd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-fd; then \
/sbin/chkconfig --del bacula-fd; \
fi
- @$(INSTALL_PROGRAM) -m 744 bacula-fd $(DESTDIR)/etc/rc.d/init.d/bacula-fd
+ @$(INSTALL_PROGRAM) -m 744 bacula-fd $(DESTDIR)/etc/init.d/bacula-fd
# set symlinks for script at startup and shutdown
@if test x$(DESTDIR) = x ; then \
/sbin/chkconfig --add bacula-fd; \
install-autostart-sd:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-sd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-sd; then \
/sbin/chkconfig --del bacula-sd; \
fi
- @$(INSTALL_PROGRAM) -m 744 bacula-sd $(DESTDIR)/etc/rc.d/init.d/bacula-sd
+ @$(INSTALL_PROGRAM) -m 744 bacula-sd $(DESTDIR)/etc/init.d/bacula-sd
# set symlinks for script at startup and shutdown
@if test x$(DESTDIR) = x ; then \
/sbin/chkconfig --add bacula-sd; \
install-autostart-dir:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-dir; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-dir; then \
/sbin/chkconfig --del bacula-dir; \
fi
- @$(INSTALL_PROGRAM) -m 744 bacula-dir $(DESTDIR)/etc/rc.d/init.d/bacula-dir
+ @$(INSTALL_PROGRAM) -m 744 bacula-dir $(DESTDIR)/etc/init.d/bacula-dir
# set symlinks for script at startup and shutdown
@if test x$(DESTDIR) = x ; then \
/sbin/chkconfig --add bacula-dir; \
uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
uninstall-autostart-fd:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-fd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-fd; then \
/sbin/chkconfig --del bacula-fd; \
fi
- @rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-fd
+ @rm -f $(DESTDIR)/etc/init.d/bacula-fd
uninstall-autostart-sd:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-sd; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-sd; then \
/sbin/chkconfig --del bacula-sd; \
fi
- @rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-sd
+ @rm -f $(DESTDIR)/etc/init.d/bacula-sd
uninstall-autostart-dir:
- @if test x$(DESTDIR) = x -a -f /etc/rc.d/init.d/bacula-dir; then \
+ @if test x$(DESTDIR) = x -a -f /etc/init.d/bacula-dir; then \
/sbin/chkconfig --del bacula-dir; \
fi
- @rm -f $(DESTDIR)/etc/rc.d/init.d/bacula-dir
+ @rm -f $(DESTDIR)/etc/init.d/bacula-dir
clean:
@rm -f 1 2 3
devclean: clean
@rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
@rm -f bacula-sd bacula-fd bacula-dir
-
+# Bacula RPM spec file
+# Copyright (C) 2004 Kern Sibbald
+
# Platform Build Configuration
# basic defines for every build
%{?build_rh8:%define rh8 1}
%define rh9 0
%{?build_rh9:%define rh9 1}
-# Fedora Core 1 build
+# Fedora Core build
%define fc1 0
%{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
# Whitebox Enterprise build
-# this should also work for RHEL
%define wb3 0
%{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+# CentOS build
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
# SuSE build
-# this is known to build on SuSE 8.2 and 9.0
%define su9 0
%{?build_su9:%define su9 1}
# Mandrake build
%{?build_mdk:%define mdk 1}
# test for a platform definition
-%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{wb3} && ! %{su9} && ! %{mdk}
+%if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{wb3} && ! %{su9} && ! %{mdk}
%{error: You must specify a platform. Please examine the spec file.}
exit 1
%endif
# set for database support desired or define the build_xxx on the command line
%define mysql 0
%{?build_mysql:%define mysql 1}
+# if using mysql 4.x define this and mysql above
+# currently: Mandrake 10.1, SuSE 9.2, RHEL4
+%define mysql4 0
+%{?build_mysql4:%define mysql4 1}
%define sqlite 0
%{?build_sqlite:%define sqlite 1}
%define postgresql 0
exit 1
%endif
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos4}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{fc3} && ! %{rhel4} && ! %{centos4}
+%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{su9}
+%define _dist %(grep SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mandrake /etc/mandrake-release)
+%endif
+
Summary: Bacula - The Network Backup Solution
Name: bacula
Version: @VERSION@
BuildRoot: %{_tmppath}/%{name}-root
URL: http://www.bacula.org/
Vendor: The Bacula Team
-Distribution: The Bacula Team
+Distribution: %{_dist}
Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
-BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel
+BuildRequires: readline-devel, atk-devel, ncurses-devel, pango-devel, perl
BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
%if %{rh7}
BuildRequires: libtermcap-devel
BuildRequires: bonobo-devel
BuildRequires: GConf-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
%if %{su9}
BuildRequires: termcap
BuildRequires: gconf2-devel
BuildRequires: linc-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
%if %{mdk}
BuildRequires: libtermcap-devel
BuildRequires: libstdc++-static-devel
BuildRequires: glibc-static-devel
BuildRequires: freetype2-devel
+BuildRequires: tetex
+BuildRequires: latex2html
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+BuildRequires: libtermcap-devel
+BuildRequires: gtk2-devel >= 2.4
+BuildRequires: libgnomeui-devel >= 2.8
+BuildRequires: glibc-devel >= 2.3
+BuildRequires: ORBit2-devel
+BuildRequires: libart_lgpl-devel >= 2.3
+BuildRequires: libbonobo-devel >= 2.8
+BuildRequires: libbonoboui-devel >= 2.8
+BuildRequires: bonobo-activation-devel
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
BuildRequires: libtermcap-devel
BuildRequires: gtk2-devel >= 2.0
BuildRequires: libgnomeui-devel >= 2.0
BuildRequires: GConf2-devel
BuildRequires: linc-devel
BuildRequires: freetype-devel
+BuildRequires: tetex
+BuildRequires: tetex-latex
%endif
-%if %{mysql}
+%if %{mysql} && ! %{mysql4}
BuildRequires: mysql-devel >= 3.23
%endif
+%if %{mysql} && %{mysql4}
+BuildRequires: mysql-devel >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
BuildRequires: rh-postgresql-devel >= 7
%endif
%if %{sqlite}
Conflicts: sqlite, sqlite-tools
%endif
+
%if %{rh7}
Requires: glibc >= 2.2
Requires: libtermcap
Requires: glibc >= 2.3
Requires: libtermcap
%endif
-%if %{mysql} && ! %{su9} && ! %{mdk}
+
+%if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-server >= 3.23
%endif
-%if %{mysql} && %{su9}
+%if %{mysql} && ! %{su9} && ! %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-server >= 4.0
+%endif
+
+%if %{mysql} && %{su9} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
-%if %{mysql} && %{mdk}
+%if %{mysql} && %{su9} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
+%if %{mysql} && %{mdk} && ! %{mysql4}
Requires: mysql >= 3.23
Requires: mysql-client >= 3.23
%endif
+%if %{mysql} && %{mdk} && %{mysql4}
+Requires: mysql >= 4.0
+Requires: mysql-client >= 4.0
+%endif
+
%if %{postgresql} && %{wb3}
Requires: rh-postgresql >= 7
Requires: rh-postgresql-server >= 7
Summary: Bacula - The Network Backup Solution
Group: System Environment/Daemons
-Requires: coreutils, util-linux, libc5, bacula-fd, cdrecord, mkisofs, make
+Requires: coreutils, util-linux, bacula-fd, cdrecord, mkisofs, make
%description rescue
Bacula - It comes by night and sucks the vital essence from your computers.
Bacula source code has been released under the GPL version 2 license.
This package installs scripts for disaster recovery and builds rescue
-floppy disks for bare metal recovery. This package includes tomsrtbt
+floppy disks and cdroms for bare metal recovery. This package includes tomsrtbt
(http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a tool
to build a boot floppy disk.
bacula-client package for your platform installed and configured before
installing this package.
-To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
+To create a floppy boot disk run "./getdiskinfo" from the /etc/bacula/rescue/floppy
directory (this is done when the package is first installed),
-then run "./install.s" from the /etc/bacula/rescue/tomsrtbt/
+then run "./install.s" from the /etc/bacula/rescue/floppy/tomsrtbt/
directory. To make the bacula rescue disk run
"./make_rescue_disk --copy-static-bacula --copy-etc-files"
-from the /etc/bacula/rescue directory. To recreate the rescue
+from the /etc/bacula/rescue/floppy directory. To recreate the rescue
information for this system run ./getdiskinfo again.
+To create a rescue cdrom run "make all" from the /etc/bacula/rescue/cdrom
+directory which will create an iso image file. You can burn that image with your
+favorite cd burning utility or run "make burn" after examining and possibly
+adjusting /etc/bacula/rescue/cdrom/Makefile. To recreate the rescue
+information for this system run /etc/bacula/rescue/cdrom/bacula/getdiskinfo again.
+
%package updatedb
Summary: Bacula - The Network Backup Solution
Requires: GConf2
Requires: freetype2
%endif
-%if ! %{rh7} && ! %{su9} && ! %{mdk}
+%if %{fc3}
+Requires: gtk2 >= 2.4
+Requires: libgnomeui >= 2.8
+Requires: glibc >= 2.3
+Requires: ORBit2
+Requires: libart_lgpl >= 2.3
+Requires: libbonobo >= 2.8
+Requires: libbonoboui >= 2.8
+Requires: bonobo-activation
+Requires: GConf2
+Requires: freetype
+%endif
+%if ! %{rh7} && ! %{su9} && ! %{mdk} && ! %{fc3}
Requires: gtk2 >= 2.0
Requires: libgnomeui >= 2.0
Requires: glibc >= 2.3
patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
%endif
+# 64 bit lib location hacks
+# this is the location on redhat type platforms, don't know about others yet
+%if %{x86_64}
+export LDFLAGS=-L/usr/lib64
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS=-L/usr/lib64/mysql
+%endif
+
%configure \
--prefix=/usr \
--sbindir=/usr/sbin \
strip static-bacula-fd
cd ../../
+cd doc/latex
+make
+cd ../../
+
%install
cwd=${PWD}
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
+mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
%if %{rh7}
mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
mtx-install
cd ${cwd}
-# setup the manual for the doc dir and correct some broken CVS permissions
+# setup the manual for the doc dir
mkdir html-manual
-cp -p doc/html-manual/*.html html-manual/
-cp -p doc/html-manual/*.jpg html-manual/
-cp -p doc/html-manual/*.gif html-manual/
-cp -p doc/html-manual/*.css html-manual/
-chmod 644 html-manual/*
-chmod 644 doc/bacula.pdf
+cp -p doc/latex/bacula/*.html html-manual/
+cp -p doc/latex/bacula/*.png html-manual/
+cp -p doc/latex/bacula/*.css html-manual/
# fixme - make installs the mysql scripts for sqlite build
%if %{sqlite}
cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
%endif
-%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{mdk}
+%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{mdk}
cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
# install the updatedb scripts
cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
+# install the logwatch scripts
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
+chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
+
# now clean up permissions that are left broken by the install
chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
chmod o-rwx $RPM_BUILD_ROOT/var/bacula
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre mysql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%{sqlite_bindir}/libsqlite.a
%{sqlite_bindir}/sqlite.h
%pre sqlite
# test for bacula database older than version 7
if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
echo "You appear to be running database version $DB_VER. You must first update"
# test for an existing database
if [ -s %{working_dir}/bacula.db ]; then
- DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | tail -n 1 2>/dev/null`
+ DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
# check to see if we need to upgrade a 1.34 or lower database
if [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade requires a database update to version 8. You appear to"
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
/etc/bacula/mtx-changer
/etc/bacula/btraceback.dbx
/etc/bacula/btraceback.gdb
+#/etc/bacula/dvd-freespace
+#/etc/bacula/dvd-writepart
/etc/init.d/bacula-dir
/etc/init.d/bacula-fd
/etc/init.d/bacula-sd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/usr/man/man1/*
/etc/logrotate.d/bacula
-
+/etc/log.d/scripts/services/bacula
%config(noreplace) /etc/bacula/bacula-dir.conf
%config(noreplace) /etc/bacula/bacula-fd.conf
%config(noreplace) /etc/bacula/bacula-sd.conf
%config(noreplace) /etc/bacula/bconsole.conf
+%config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
+%config(noreplace) /etc/log.d/conf/services/bacula.conf
/etc/bacula/query.sql
%dir %{working_dir}
%pre postgresql
# test for bacula database older than version 7
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "7" ]; then
echo "This bacula upgrade will update a bacula database from version 7 to 8."
# test for an existing database
# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula | tail -3 | head -1 2>/dev/null`
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
echo "Hmm, doesn't look like you have an existing database."
- echo "Granting privileges for PostgreSQL user bacula..."
- /etc/bacula/grant_postgresql_privileges
echo "Creating PostgreSQL bacula database..."
/etc/bacula/create_postgresql_database
echo "Creating bacula tables..."
/etc/bacula/make_postgresql_tables
+ echo "Granting privileges for PostgreSQL user bacula..."
+ /etc/bacula/grant_postgresql_privileges
# check to see if we need to upgrade a 1.34 or lower database
elif [ "$DB_VER" -lt "8" ]; then
fi
# create the daemon group
-HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
echo "The group %{daemon_group} has been added to %{groupfile}."
/etc/bacula/bconsole
/etc/init.d/bacula-fd
-%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
+%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
+%doc doc/latex/bacula.pdf doc/latex/developers.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
/etc/logrotate.d/bacula
%config(noreplace) /etc/bacula/bacula-fd.conf
HAVE_BACULA=`cat %{group_file} | grep %{daemon_group} 2>/dev/null`
if [ -z $HAVE_BACULA ]; then
%{groupadd} -r %{daemon_group} > /dev/null 2>&1
- echo "The group %{daemon_group} has been added to %{groupfile}."
+ echo "The group %{daemon_group} has been added to %{group_file}."
echo "See the manual chapter Running Bacula for details."
fi
%post rescue
# link our current installed conf file to the rescue directory
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
-ln -s /etc/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/floppy/bacula-fd.conf
+ln -s /etc/bacula/bacula-fd.conf /etc/bacula/rescue/cdrom/bin/bacula-fd.conf
# run getdiskinfo
echo "Creating rescue files for this system..."
%if ! %{rh7} && ! %{rh8}
/usr/sbin/bacula-tray-monitor
-/etc/bacula/tray-monitor.conf
+%config(noreplace) /etc/bacula/tray-monitor.conf
/usr/share/pixmaps/bacula-tray-monitor.xpm
/usr/share/applications/bacula-tray-monitor.desktop
%endif
%changelog
+* Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 1.36.3 update docs
+* Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add centos4 build tag
+- add x86_64 build tag
+* Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel4 build tag
+- clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
+* Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add rhel3 build tag
+* Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix tray-monitor.conf for noreplace
+* Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix distribution check for Fedora and Whitebox
+* Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add logwatch script
+- add dvd scripts
+* Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add build for Fedora Core 3 (linc now included in ORDit2)
+- add mysql4 define for Mandrake 10.1
+* Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix {group_file} variable in post scripts
+* Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add distribution checking and custom Distribution tag
+* Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- ASSIGNMENT OF COPYRIGHT
+- FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
+- assigns unto Kern Sibbald, his successors, assigns and personal representatives,
+- all right, title and interest in and to the copyright in this software RPM
+- spec file. D. Scott Barninger warrants good title to said copyright, that it is
+- free of all liens, encumbrances or any known claims against said copyright.
+* Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
+- bug 183 fixes
+- thanks to Daniel Widyono
+- update description for rescue package to describe cdrom creation
* Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
- update depkgs to 29Oct04
* Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
-bacula-tray-monitor.desktop
bacula-tray-monior.desktop
.xvpics
logrotate
PSCMD="@PSCMD@"
+#
+# On Solaris, you may need to use nawk, or alternatively,
+# add the GNU binaries to your path, such as /usr/xpg4/bin
+#
+AWK=@AWK@
+
# All these are not *really* needed but it makes it
# easier to "steal" this code for the development
# environment where they are different.
SD_USER=@sd_user@
SD_GROUP=@sd_group@
+PIDOF=@PIDOF@
+
# A function to stop a program.
killproc() {
RC=0
fi
# Next try "pidof"
- if [ -x /sbin/pidof ] ; then
- pid=`/sbin/pidof $1`
+ if [ -x ${PIDOF} ] ; then
+ pid=`${PIDOF} $1`
fi
if [ "$pid" != "" ] ; then
echo $pid
fi
# Finally try to extract it from ps
- ${PSCMD} | grep $1 | awk '{ print $1 }' | tr '\n' ' '
+ ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' '
return 0
}
status() {
+ pid=""
# Test syntax.
if [ $# = 0 ] ; then
echo "Usage: status {program}"
base=`basename $1`
# First try "pidof"
- if [ -x /sbin/pidof ] ; then
- pid=`/sbin/pidof $1`
+ if [ -x ${PIDOF} ] ; then
+ pid=`${PIDOF} $1`
fi
if [ "$pid" != "" ] ; then
echo "$base (pid $pid) is running..."
return 0
else
- pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 }
+ pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 }
{ if ((prog == $2) || (("(" prog ")") == $2) ||
(("[" prog "]") == $2) ||
((prog ":") == $2)) { print $1 ; exit 0 } }' $1`
# $2 = main pid of running program to be traced back.
#
PNAME=`basename $1`
-if test `uname -s` = SunOs ; then
+if test `uname -s` = SunOS ; then
gcore -o @working_dir@/${PNAME} $2
dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \
| @sbindir@/bsmtp -h @smtp_host@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
--- /dev/null
+# Makefile to install logwatch script
+# 08 Jan 2005 D. Scott Barninger
+
+SYSCONFDIR=/etc/log.d
+INSTALL=@INSTALL@
+
+all: install
+
+install:
+
+ $(INSTALL) -m 755 bacula $(DESTDIR)$(SYSCONFDIR)/scripts/services/bacula
+ $(INSTALL) -m 644 logfile.bacula.conf $(DESTDIR)$(SYSCONFDIR)/conf/logfiles/bacula.conf
+ $(INSTALL) -m 644 services.bacula.conf $(DESTDIR)$(SYSCONFDIR)/conf/services/bacula.conf
+
+uninstall:
+ rm -f $(DESTDIR)$(SYSCONFDIR)/scripts/services/bacula
+ rm -f $(DESTDIR)$(SYSCONFDIR)/conf/logfiles/bacula.conf
+ rm -f $(DESTDIR)$(SYSCONFDIR)/conf/services/bacula.conf
--- /dev/null
+#!/usr/bin/perl -w
+#
+# logwatch filter script for bacula log files
+#
+# Mon Jan 03 2005
+# D. Scott Barninger and Karl Cunningham
+#
+# Copyright 2005 Kern Sibbald
+# licensed under GPL-v2
+
+use strict;
+use POSIX qw(strftime);
+
+my (@JobName,$JobStatus,$ThisName,$ThisStatus,$ThisDate,$SearchDate);
+my ($Job,$JobId,$JobDate,$Debug,$DebugCounter,%data,$time);
+
+# set the logwatch search date we want
+$time = time;
+
+if ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'yesterday') {
+ $SearchDate = strftime("%Y-%m-%d", localtime($time-86400));
+}
+elsif ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'today') {
+ $SearchDate = strftime("%Y-%m-%d", localtime($time));
+}
+
+# set debug level
+$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
+
+if ( $Debug >= 5 ) {
+ print STDERR "\n\nDEBUG: Inside Bacula Filter \n\n";
+ $DebugCounter = 1;
+}
+
+while (<STDIN>) {
+ chomp;
+ if ( $Debug >= 5 ) {
+ print STDERR "DEBUG($DebugCounter): $_\n";
+ $DebugCounter++;
+ }
+
+ # Test the line for a new entry, which is a jobid record
+ if (/^\s*JobId:\s+(\d+)/) {
+ # A new entry. Test, then save the previous stuff and
+ # set up to grab more.
+ if ($JobId and $Job and $JobStatus and $JobDate) {
+ $data{$JobId} = {
+ "Job" => $Job,
+ "JobStatus" => $JobStatus,
+ "JobDate" => $JobDate,
+ };
+ $Job = $JobStatus = $JobDate = "";
+ }
+ $JobId = $1;
+ next;
+ }
+ (/^\s*Job:\s*(.*)/) and $Job = $1;
+ (/^\s*Termination:\s*(.*)/) and $JobStatus = $1;
+ (/^\s*Job:.*(\d{4}-\d{2}-\d{2})/) and $JobDate = $1;
+}
+
+# if we have data print it out, otherwise do nothing
+if (scalar(keys(%data))) {
+ print "\nJobs Run:\n";
+ foreach my $Id (sort {$a<=>$b} (keys(%data))) {
+ $ThisName = $data{$Id}{Job};
+ $ThisStatus = $data{$Id}{JobStatus};
+ $ThisDate = $data{$Id}{JobDate};
+ $ThisName =~ s/\s//g;
+ $ThisStatus =~ s/\s//g;
+ if ( $ENV{'LOGWATCH_DATE_RANGE'} eq 'all') {
+ $SearchDate = $ThisDate;
+ }
+ if ($ThisDate eq $SearchDate) {
+ print "$ThisDate $Id $ThisName\n $ThisStatus\n\n";
+ }
+ }
+}
+
+exit(0);
+
+
--- /dev/null
+# What actual file? Defaults to LogPath if not absolute path....
+LogFile = @working_dir@/log
+
--- /dev/null
+Title = "bacula"
+
+# Which logfile group...
+LogFile = bacula
+
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#endif
/* Allow printing of NULL pointers */
-#define NPRT(x) (x)?(x):"*None*"
+#define NPRT(x) (x)?(x):"*None*"
#ifdef ENABLE_NLS
#include <libintl.h>
#define MAXSTRING 500
/* Maximum length to edit time/date */
-#define MAX_TIME_LENGTH 50
+#define MAX_TIME_LENGTH 50
/* Maximum Name length including EOS */
#define MAX_NAME_LENGTH 128
/* All tape operations MUST be a multiple of this */
#define TAPE_BSIZE 1024
-#if !defined(DEV_BSIZE) && defined(BSIZE)
-#define DEV_BSIZE BSIZE
+
+#ifdef DEV_BSIZE
+#define B_DEV_BSIZE DEV_BSIZE
+#endif
+
+#if !defined(B_DEV_BSIZE) & defined(BSIZE)
+#define B_DEV_BSIZE BSIZE
#endif
-#ifndef DEV_BSIZE
-#define DEV_BSIZE 512
+#ifndef B_DEV_BSIZE
+#define B_DEV_BSIZE 512
#endif
/*
#define STREAM_WIN32_GZIP_DATA 12 /* Gzipped Win32 BackupRead data */
#define STREAM_MACOS_FORK_DATA 13 /* Mac resource fork */
#define STREAM_HFSPLUS_ATTRIBUTES 14 /* Mac OS extra attributes */
-#define STREAM_UNIX_ATTRIBUTES_ACL 15 /* ACL attributes on UNIX */
+/*** FIXME ***/
+#define STREAM_UNIX_ATTRIBUTES_ACCESS_ACL 15 /* Standard ACL attributes on UNIX */
+#define STREAM_UNIX_ATTRIBUTES_ACL 15 /* Standard ACL attributes on UNIX */
+#define STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL 16 /* Default ACL attributes on UNIX */
+/*** FIXME ***/
+
-/*
- * File type (Bacula defined).
+/*
+ * File type (Bacula defined).
* NOTE!!! These are saved in the Attributes record on the tape, so
* do not change them. If need be, add to them.
*
* additional optional fields in the attribute record.
*/
#define FT_MASK 0xFFFF /* Bits used by FT (type) */
-#define FT_LNKSAVED 1 /* hard link to file already saved */
+#define FT_LNKSAVED 1 /* hard link to file already saved */
#define FT_REGE 2 /* Regular file but empty */
#define FT_REG 3 /* Regular file */
#define FT_LNK 4 /* Soft Link */
* that it can filter packets, but otherwise, it is not used
* or saved */
#define FT_DIRBEGIN 18 /* Directory at beginning (not saved) */
+#define FT_INVALIDFS 19 /* File system not allowed for */
/* Definitions for upper part of type word (see above). */
#define AR_DATA_STREAM (1<<16) /* Data stream id present */
#define MD5_SIG 1
#define SHA1_SIG 2
+/*
+ * Tape label types -- stored in catalog
+ */
+#define B_BACULA_LABEL 0
+#define B_ANSI_LABEL 1
+#define B_IBM_LABEL 2
+
/* Size of File Address stored in STREAM_SPARSE_DATA. Do NOT change! */
#define SPARSE_FADDR_SIZE (sizeof(uint64_t))
#define Pmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
#define Pmsg14(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) p_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)
-
+
/* Daemon Error Messages that are delivered according to the message resource */
#define Emsg0(typ, lvl, msg) e_msg(__FILE__, __LINE__, typ, lvl, msg)
#define Emsg1(typ, lvl, msg, a1) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1)
#define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
#endif
+/* =============================================================
+ * OS Dependent defines
+ * =============================================================
+ */
+
+#ifndef HAVE_FSEEKO
+/* Bad news. This OS cannot handle 64 bit fseeks and ftells */
+#define fseeko fseek
+#define ftello ftell
+#endif
+
+
#ifdef __alpha__
#define OSF 1
#endif
#ifdef HAVE_SUN_OS
- /*
+ /*
* On Solaris 2.5, threads are not timesliced by default, so we need to
* explictly increase the conncurrency level.
*/
#ifdef HAVE_DARWIN_OS
/* Apparently someone forgot to wrap getdomainname as a C function */
extern "C" int getdomainname(char *name, int len);
-
-/* Darwin lib fnmatch() doesn't work, so use our own */
-#undef HAVE_FNMATCH
#endif
#ifdef HAVE_CYGWIN
extern "C" int fchdir(int filedes);
extern "C" long gethostid(void);
#endif
-
+
/* This probably should be done on a machine by machine basic, but it works */
#define ALIGN_SIZE (sizeof(double))
#define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
/*
* Replace codes needed in both file routines and non-file routines
- * Job replace codes -- in "replace"
+ * Job replace codes -- in "replace"
*/
#define REPLACE_ALWAYS 'a'
#define REPLACE_IFNEWER 'w'
#endif
#ifdef HAVE_NL_LANGINFO
#include <langinfo.h>
-#else
+#else
#define nl_langinfo(x) ("ANSI_X3.4-1968")
#endif
DROP TABLE IF EXISTS BaseFiles;
DROP TABLE IF EXISTS UnsavedFiles;
DROP TABLE IF EXISTS CDImages;
+DROP TABLE IF EXISTS Status;
END-OF-DATA
then
echo "Deletion of Bacula MySQL tables succeeded."
FilenameId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Name BLOB NOT NULL,
PRIMARY KEY(FilenameId),
- INDEX (Name(30))
+ INDEX (Name(255))
);
CREATE TABLE Path (
PathId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Path BLOB NOT NULL,
PRIMARY KEY(PathId),
- INDEX (Path(50))
+ INDEX (Path(255))
);
LStat TINYBLOB NOT NULL,
MD5 TINYBLOB NOT NULL,
PRIMARY KEY(FileId),
- INDEX (FilenameId, PathId)
+ INDEX (JobId, PathId, FilenameId)
);
#
# INDEX (JobId),
# INDEX (PathId),
# INDEX (FilenameId),
-# INDEX (JobId, PathId, FilenameId)
+# INDEX (FilenameId, PathId)
#
CREATE TABLE Job (
{
if (mr->InChanger != 0 && mr->Slot != 0) {
Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
- "Slot=%d AND MediaId!=%u", mr->Slot, mr->MediaId);
+ "Slot=%d AND PoolId=%u AND MediaId!=%u",
+ mr->Slot, mr->PoolId, mr->MediaId);
Dmsg1(400, "%s\n", mdb->cmd);
UPDATE_DB(jcr, mdb, mdb->cmd);
}
-/*
- Generalized console input/output handler
+/*
+ Generalized console input/output handler
A maintanable replacement for readline()
Updated for Bacula, Kern Sibbald, December MMIII
This code is in part derived from code that I wrote in
1981, so some of it is a bit old and could use a cleanup.
-
+
*/
/*
Copyright (C) 1981-2004 Kern Sibbald and John Walker
*/
-/*
+/*
* UTF-8
* If the top bit of a UTF-8 string is 0 (8 bits), then it
* is a normal ASCII character.
#include <stdlib.h>
#include <signal.h>
#include <string.h>
-#include <ctype.h>
+#include <ctype.h>
#else
/* We are in Bacula */
extern "C" int tgetnum(const char *);
extern "C" char *tgetstr (const char*, char**);
extern "C" char *tgoto (const char *, int, int);
+#elif HAVE_HPUX_OS
+#include <term.h>
#else
#include <termcap.h>
#endif
/* From termios library */
+#ifdef HAVE_HPUX_OS
+static char *BC;
+static char *UP;
+#else
extern char *BC;
extern char *UP;
+#endif
/* Forward referenced functions */
extern "C" {
void trapctlc();
int usrbrk();
void clrbrk();
-
+
void con_init(FILE *input)
{
- atexit(con_term);
+ atexit(con_term);
rawmode(input);
trapctlc();
}
static unsigned do_smap(unsigned c)
{
char str[MAX_STAB];
- int len = 0;
+ int len = 0;
stab_t *tstab;
int i, found;
unsigned cm;
{
stab_t *tstab;
int len;
-
+
if (!str) {
return;
}
}
tstab->next = stab[tstab->len-1];
stab[tstab->len-1] = tstab;
-/* printf("Add_smap tstab=%x len=%d func=%d tstab->next=%x\n\r", tstab, len,
+/* printf("Add_smap tstab=%x len=%d func=%d tstab->next=%x\n\r", tstab, len,
func, tstab->next); */
}
curline[cp++] = c; /* store character in line being built */
t_char(c); /* echo character to terminal */
while (more--) {
- c= input_char();
+ c= input_char();
insert_hole(curline, sizeof(curline));
curline[cp++] = c; /* store character in line being built */
t_char(c); /* echo character to terminal */
}
/* How many characters under the cursor */
-static int
+static int
char_count(int cptr, char *str)
{
int cnt = 1;
/* Backup cursor keeping characters under it */
static void
-backup(char *str)
+backup(char *str)
{
if (cp == 0) {
return;
/* Delete the character under the cursor */
static void
-delchr(int del, char *curline, int line_len)
+delchr(int del, char *curline, int line_len)
{
int i, cnt;
asclrl(pos, width); /* clear to end of line */
}
-/* Helper function to add string preceded by
+/* Helper function to add string preceded by
* ESC to smap table */
static void add_esc_smap(const char *str, int func)
{
exit(1);
}
old_term_params_set = true;
- t = old_term_params;
+ t = old_term_params;
t.c_cc[VMIN] = 1; /* satisfy read after 1 char */
t.c_cc[VTIME] = 0;
- t.c_iflag &= ~(BRKINT | IGNPAR | PARMRK | INPCK |
- ISTRIP | ICRNL | IXON | IXOFF | INLCR | IGNCR);
+ t.c_iflag &= ~(BRKINT | IGNPAR | PARMRK | INPCK |
+ ISTRIP | ICRNL | IXON | IXOFF | INLCR | IGNCR);
t.c_iflag |= IGNBRK;
t.c_oflag |= ONLCR;
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON |
signal(SIGHUP, SIG_IGN);
// signal(SIGSTOP, SIG_IGN);
signal(SIGINT, sigintcatcher);
- signal(SIGWINCH, SIG_IGN);
+ signal(SIGWINCH, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
// signal(SIGTSTP, SIG_IGN);
if (read(0, &c, 1) != 1) {
c = 0;
}
- return (unsigned)c;
+ return (unsigned)c;
}
-
+
/* Send message to terminal - primitive routine */
void
t_sendl(const char *msg, int len)
/* ASCLRL() -- Clear to end of line from current position */
-static void asclrl(int pos, int width)
+static void asclrl(int pos, int width)
{
int i;
for (i=1; i<=width-pos+1; i++) /* backspace to original position */
t_char(0x8);
return;
-
+
}
{
t_send((char *)tgoto(t_cm, x, y));
}
-
+
/* ASCLRS -- Clear whole screen */
-static void asclrs()
+static void asclrs()
{
ascurs(0,0);
t_send(t_cs);
#ifdef HAVE_CONIO
#include "conio.h"
#else
-#define con_init(x)
+#define con_init(x)
#define con_term()
#define con_set_zed_keys();
#define trapctlc()
#define clrbrk()
-#define usrbrk() 0
+#define usrbrk() 0
#endif
#ifdef HAVE_WIN32
#define isatty(fd) (fd==0)
DWORD g_platform_id = VER_PLATFORM_WIN32_WINDOWS;
#endif
-
+
/* Exported variables */
#ifdef HAVE_CYGWIN
/* Static variables */
static char *configfile = NULL;
static BSOCK *UA_sock = NULL;
-static DIRRES *dir;
+static DIRRES *dir;
static FILE *output = stdout;
static bool tee = false; /* output to output and stdout */
static bool stop = false;
" -dnn set debug level to nn\n"
" -s no signals\n"
" -t test - read configuration and exit\n"
-" -? print this message.\n"
+" -? print this message.\n"
"\n"), HOST_OS, DISTNAME, DISTVER);
}
-extern "C"
+extern "C"
void got_sigstop(int sig)
{
stop = true;
}
-extern "C"
+extern "C"
void got_sigcontinue(int sig)
{
stop = false;
}
-extern "C"
-void got_sigtout(int sig)
+extern "C"
+void got_sigtout(int sig)
{
// printf("Got tout\n");
}
-extern "C"
+extern "C"
void got_sigtin(int sig)
-{
+{
// printf("Got tin\n");
}
/*
* These are the @command
*/
-struct cmdstruct { const char *key; int (*func)(FILE *input, BSOCK *UA_sock); const char *help; };
+struct cmdstruct { const char *key; int (*func)(FILE *input, BSOCK *UA_sock); const char *help; };
static struct cmdstruct commands[] = {
{ N_("input"), inputcmd, _("input from file")},
{ N_("output"), outputcmd, _("output to file")},
}
-static void read_and_process_input(FILE *input, BSOCK *UA_sock)
+static void read_and_process_input(FILE *input, BSOCK *UA_sock)
{
const char *prompt = "*";
bool at_prompt = false;
int tty_input = isatty(fileno(input));
int stat;
- for ( ;; ) {
+ for ( ;; ) {
if (at_prompt) { /* don't prompt multiple times */
prompt = "";
} else {
usage();
con_term();
exit(1);
- }
+ }
}
argc -= optind;
argv += optind;
UnlockRes();
if (ndir == 0) {
con_term();
- Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s\n\
-Without that I don't how to speak to the Director :-(\n"), configfile);
+ Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s\n"
+"Without that I don't how to speak to the Director :-(\n"), configfile);
}
if (test_config) {
dir = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
UnlockRes();
}
-
+
senditf(_("Connecting to Director %s:%d\n"), dir->address,dir->DIRport);
- UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
+ UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
NULL, dir->DIRport, 0);
if (UA_sock == NULL) {
terminate_console(0);
#include "history.h"
-int
+int
get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec)
{
char *line;
}
}
-/*
- * Get next input command from terminal.
+/*
+ * Get next input command from terminal.
*
* Returns: 1 if got input
* 0 if timeout
* -1 if EOF or error
*/
-int
+int
get_cmd(FILE *input, const char *prompt, BSOCK *sock, int sec)
{
- int len;
+ int len;
if (!stop) {
if (output == stdout || tee) {
sendit(prompt);
switch (wait_for_data(fileno(input), sec)) {
case 0:
return 0; /* timeout */
- case -1:
+ case -1:
return -1; /* error */
default:
len = sizeof_pool_memory(sock->msg) - 1;
}
fd = fopen(argk[1], "r");
if (!fd) {
- senditf(_("Cannot open file %s for input. ERR=%s\n"),
+ senditf(_("Cannot open file %s for input. ERR=%s\n"),
argk[1], strerror(errno));
- return 1;
+ return 1;
}
read_and_process_input(fd, UA_sock);
fclose(fd);
}
fd = fopen(argk[1], mode);
if (!fd) {
- senditf(_("Cannot open file %s for output. ERR=%s\n"),
+ senditf(_("Cannot open file %s for output. ERR=%s\n"),
argk[1], strerror(errno));
- return 1;
+ return 1;
}
output = fd;
return 1;
{
#ifdef xHAVE_CONIO
if (output == stdout || tee) {
- char *p, *q;
+ char *p, *q;
/*
* Here, we convert every \n into \r\n because the
- * terminal is in raw mode when we are using
+ * terminal is in raw mode when we are using
* conio.
*/
for (p=q=buf; (p=strchr(q, '\n')); ) {
}
#else
fputs(buf, output);
+ fflush(output);
if (tee) {
fputs(buf, stdout);
}
- if (output == stdout || tee) {
+ if (output != stdout || tee) {
fflush(stdout);
}
#endif
/* External functions */
-/*
+/*
* Returns: 0 on failure
* 1 on success
*/
-int do_admin(JCR *jcr)
+int do_admin(JCR *jcr)
{
jcr->jr.JobId = jcr->JobId;
set_jcr_job_status(jcr, TermCode);
update_job_end_record(jcr); /* update database */
-
+
if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) {
- Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"),
+ Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"),
db_strerror(jcr->db));
set_jcr_job_status(jcr, JS_ErrorTerminated);
}
break;
case JS_FatalError:
case JS_ErrorTerminated:
- term_msg = _("*** Admin Error ***");
+ term_msg = _("*** Admin Error ***");
msg_type = M_ERROR; /* Generate error message */
break;
case JS_Canceled:
bstrftime(sdt, sizeof(sdt), jcr->jr.StartTime);
bstrftime(edt, sizeof(edt), jcr->jr.EndTime);
- Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\
- JobId: %d\n\
- Job: %s\n\
- Start time: %s\n\
- End time: %s\n\
- Termination: %s\n\n"),
+ Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+" JobId: %d\n"
+" Job: %s\n"
+" Start time: %s\n"
+" End time: %s\n"
+" Termination: %s\n\n"),
edt,
jcr->jr.JobId,
jcr->jr.Job,
term_msg);
Dmsg0(100, "Leave admin_cleanup()\n");
-}
+}
stop_bsock_timer(tid);
Dmsg0(50, _("Director and Storage daemon passwords or names not the same.\n"));
Jmsg0(jcr, M_FATAL, 0,
- _("Director and Storage daemon passwords or names not the same or\n"
- "you have exceeded the Maximum Concurrent Jobs on the SD.\n"
+ _("Unable to authenticate with Storage daemon. Possible causes:\n"
+ "Passwords or names not the same or\n"
+ "Maximum Concurrent Jobs exceeded on the SD or\n"
+ "SD networking messed up (restart daemon).\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
return 0;
}
stop_bsock_timer(tid);
Dmsg0(50, _("Director and File daemon passwords or names not the same.\n"));
Jmsg(jcr, M_FATAL, 0,
- _("Director and File daemon passwords or names not the same or\n"
- "you have exceeded the Maximum Concurrent Jobs on the FD.\n"
+ _("Unable to authenticate with File daemon. Possible causes:\n"
+ "Passwords or names not the same or\n"
+ "Maximum Concurrent Jobs exceeded on the FD or\n"
+ "FD networking messed up (restart daemon).\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
return 0;
}
JCR *jcr;
int njobs = 0; /* number of running jobs */
int table, rtable;
+ bool ok;
if (already_here) {
abort(); /* Oops, recursion -> die */
reload_table[table].res_table = save_config_resources();
Dmsg1(100, "Saved old config in table %d\n", table);
- parse_config(configfile);
+ ok = parse_config(configfile, 0); /* no exit on error */
Dmsg0(100, "Reloaded config file\n");
- if (!check_resources()) {
+ if (!ok || !check_resources()) {
rtable = find_free_reload_table_entry(); /* save new, bad table */
if (rtable < 0) {
Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
Jmsg(NULL, M_ERROR_TERM, 0, _("Out of reload table entries. Giving up.\n"));
} else {
Jmsg(NULL, M_ERROR, 0, _("Please correct configuration file: %s\n"), configfile);
+ Jmsg(NULL, M_ERROR, 0, _("Resetting previous configuration.\n"));
}
reload_table[rtable].res_table = save_config_resources();
/* Now restore old resoure values */
job = (JOB *)GetNextRes(R_JOB, NULL);
director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
if (!director) {
- Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n\
-Without that I don't know who I am :-(\n"), configfile);
+ Jmsg(NULL, M_FATAL, 0, _("No Director resource defined in %s\n"
+"Without that I don't know who I am :-(\n"), configfile);
OK = false;
} else {
set_working_directory(director->working_directory);
/* From job.c */
void dird_free_jcr(JCR *jcr);
+void dird_free_jcr_pointers(JCR *jcr);
* 1. The generic lexical scanner in lib/lex.c and lib/lex.h
*
* 2. The generic config scanner in lib/parse_config.c and
- * lib/parse_config.h.
- * These files contain the parser code, some utility
- * routines, and the common store routines (name, int,
- * string).
+ * lib/parse_config.h.
+ * These files contain the parser code, some utility
+ * routines, and the common store routines (name, int,
+ * string).
*
* 3. The daemon specific file, which contains the Resource
- * definitions as well as any specific store routines
- * for the resource records.
+ * definitions as well as any specific store routines
+ * for the resource records.
*
* Kern Sibbald, January MM
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/*
* Director Resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0},
/*
* Console Resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM con_items[] = {
{"name", store_name, ITEM(res_con.hdr.name), 0, ITEM_REQUIRED, 0},
/*
* Client or File daemon resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM cli_items[] = {
/* Storage daemon resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM store_items[] = {
{"name", store_name, ITEM(res_store.hdr.name), 0, ITEM_REQUIRED, 0},
/*
* Catalog Resource Directives
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM cat_items[] = {
{"name", store_name, ITEM(res_cat.hdr.name), 0, ITEM_REQUIRED, 0},
{"user", store_str, ITEM(res_cat.db_user), 0, 0, 0},
{"dbname", store_str, ITEM(res_cat.db_name), 0, ITEM_REQUIRED, 0},
{"dbsocket", store_str, ITEM(res_cat.db_socket), 0, 0, 0},
+ /* Turned off for the moment */
{"multipleconnections", store_yesno, ITEM(res_cat.mult_db_connections), 0, 0, 0},
{NULL, NULL, NULL, 0, 0, 0}
};
/*
* Job Resource Directives
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
RES_ITEM job_items[] = {
{"name", store_name, ITEM(res_job.hdr.name), 0, ITEM_REQUIRED, 0},
/* FileSet resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM fs_items[] = {
{"name", store_name, ITEM(res_fs.hdr.name), 0, ITEM_REQUIRED, 0},
{"include", store_inc, NULL, 0, ITEM_NO_EQUALS, 0},
{"exclude", store_inc, NULL, 1, ITEM_NO_EQUALS, 0},
{"ignorefilesetchanges", store_yesno, ITEM(res_fs.ignore_fs_changes), 1, ITEM_DEFAULT, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, NULL, 0, 0, 0}
};
/* Schedule -- see run_conf.c */
/* Schedule
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM sch_items[] = {
{"name", store_name, ITEM(res_sch.hdr.name), 0, ITEM_REQUIRED, 0},
/* Pool resource
*
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM pool_items[] = {
{"name", store_name, ITEM(res_pool.hdr.name), 0, ITEM_REQUIRED, 0},
/*
* Counter Resource
- * name handler value code flags default_value
+ * name handler value code flags default_value
*/
static RES_ITEM counter_items[] = {
{"name", store_name, ITEM(res_counter.hdr.name), 0, ITEM_REQUIRED, 0},
* NOTE!!! keep it in the same order as the R_codes
* or eliminate all resources[rindex].name
*
- * name items rcode res_head
+ * name items rcode res_head
*/
RES_TABLE resources[] = {
{"director", dir_items, R_DIRECTOR},
{"counter", counter_items, R_COUNTER},
{"console", con_items, R_CONSOLE},
{"jobdefs", job_items, R_JOBDEFS},
- {NULL, NULL, 0}
+ {NULL, NULL, 0}
};
/* Keywords (RHS) permitted in Job Level records
*
- * level_name level job_type
+ * level_name level job_type
*/
struct s_jl joblevels[] = {
{"Full", L_FULL, JT_BACKUP},
{"Data", L_VERIFY_DATA, JT_VERIFY},
{" ", L_NONE, JT_ADMIN},
{" ", L_NONE, JT_RESTORE},
- {NULL, 0, 0}
+ {NULL, 0, 0}
};
/* Keywords (RHS) permitted in Job type records
*
- * type_name job_type
+ * type_name job_type
*/
struct s_jt jobtypes[] = {
{"backup", JT_BACKUP},
{"admin", JT_ADMIN},
{"verify", JT_VERIFY},
{"restore", JT_RESTORE},
- {NULL, 0}
+ {NULL, 0}
};
#ifdef old_deprecated_code
{"client", 'C'},
{"fileset", 'F'},
{"level", 'L'},
- {NULL, 0}
+ {NULL, 0}
};
/* Keywords (RHS) permitted in Restore records */
{"where", 'W'}, /* root of restore */
{"replace", 'R'}, /* replacement options */
{"bootstrap", 'B'}, /* bootstrap file */
- {NULL, 0}
+ {NULL, 0}
};
#endif
{"ifnewer", REPLACE_IFNEWER},
{"ifolder", REPLACE_IFOLDER},
{"never", REPLACE_NEVER},
- {NULL, 0}
+ {NULL, 0}
};
const char *level_to_str(int level)
bsnprintf(level_no, sizeof(level_no), "%d", level); /* default if not found */
for (i=0; joblevels[i].level_name; i++) {
if (level == joblevels[i].level) {
- str = joblevels[i].level_name;
- break;
+ str = joblevels[i].level_name;
+ break;
}
}
return str;
sendit(sock, "No %s resource defined\n", res_to_str(type));
return;
}
- if (type < 0) { /* no recursion */
+ if (type < 0) { /* no recursion */
type = - type;
recurse = false;
}
switch (type) {
case R_DIRECTOR:
sendit(sock, "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n",
- reshdr->name, res->res_dir.MaxConcurrentJobs,
- edit_uint64(res->res_dir.FDConnectTimeout, ed1),
- edit_uint64(res->res_dir.SDConnectTimeout, ed2));
+ reshdr->name, res->res_dir.MaxConcurrentJobs,
+ edit_uint64(res->res_dir.FDConnectTimeout, ed1),
+ edit_uint64(res->res_dir.SDConnectTimeout, ed2));
if (res->res_dir.query_file) {
sendit(sock, " query_file=%s\n", res->res_dir.query_file);
}
if (res->res_dir.messages) {
sendit(sock, " --> ");
- dump_resource(-R_MSGS, (RES *)res->res_dir.messages, sendit, sock);
+ dump_resource(-R_MSGS, (RES *)res->res_dir.messages, sendit, sock);
}
break;
case R_CONSOLE:
sendit(sock, "Console: name=%s SSL=%d\n",
- res->res_con.hdr.name, res->res_con.enable_ssl);
+ res->res_con.hdr.name, res->res_con.enable_ssl);
break;
case R_COUNTER:
if (res->res_counter.WrapCounter) {
sendit(sock, "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n",
- res->res_counter.hdr.name, res->res_counter.MinValue,
- res->res_counter.MaxValue, res->res_counter.CurrentValue,
- res->res_counter.WrapCounter->hdr.name);
+ res->res_counter.hdr.name, res->res_counter.MinValue,
+ res->res_counter.MaxValue, res->res_counter.CurrentValue,
+ res->res_counter.WrapCounter->hdr.name);
} else {
sendit(sock, "Counter: name=%s min=%d max=%d\n",
- res->res_counter.hdr.name, res->res_counter.MinValue,
- res->res_counter.MaxValue);
+ res->res_counter.hdr.name, res->res_counter.MinValue,
+ res->res_counter.MaxValue);
}
if (res->res_counter.Catalog) {
sendit(sock, " --> ");
- dump_resource(-R_CATALOG, (RES *)res->res_counter.Catalog, sendit, sock);
+ dump_resource(-R_CATALOG, (RES *)res->res_counter.Catalog, sendit, sock);
}
break;
case R_CLIENT:
sendit(sock, "Client: name=%s address=%s FDport=%d MaxJobs=%u\n",
- res->res_client.hdr.name, res->res_client.address, res->res_client.FDport,
- res->res_client.MaxConcurrentJobs);
+ res->res_client.hdr.name, res->res_client.address, res->res_client.FDport,
+ res->res_client.MaxConcurrentJobs);
sendit(sock, " JobRetention=%s FileRetention=%s AutoPrune=%d\n",
- edit_utime(res->res_client.JobRetention, ed1, sizeof(ed1)),
- edit_utime(res->res_client.FileRetention, ed2, sizeof(ed2)),
- res->res_client.AutoPrune);
+ edit_utime(res->res_client.JobRetention, ed1, sizeof(ed1)),
+ edit_utime(res->res_client.FileRetention, ed2, sizeof(ed2)),
+ res->res_client.AutoPrune);
if (res->res_client.catalog) {
sendit(sock, " --> ");
- dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock);
+ dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock);
}
break;
case R_STORAGE:
sendit(sock, "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n\
DeviceName=%s MediaType=%s\n",
- res->res_store.hdr.name, res->res_store.address, res->res_store.SDport,
- res->res_store.MaxConcurrentJobs,
- res->res_store.dev_name, res->res_store.media_type);
+ res->res_store.hdr.name, res->res_store.address, res->res_store.SDport,
+ res->res_store.MaxConcurrentJobs,
+ res->res_store.dev_name, res->res_store.media_type);
break;
case R_CATALOG:
sendit(sock, "Catalog: name=%s address=%s DBport=%d db_name=%s\n\
db_user=%s\n",
- res->res_cat.hdr.name, NPRT(res->res_cat.db_address),
- res->res_cat.db_port, res->res_cat.db_name, NPRT(res->res_cat.db_user));
+ res->res_cat.hdr.name, NPRT(res->res_cat.db_address),
+ res->res_cat.db_port, res->res_cat.db_name, NPRT(res->res_cat.db_user));
break;
case R_JOB:
case R_JOBDEFS:
sendit(sock, "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n",
type == R_JOB ? "Job" : "JobDefs",
- res->res_job.hdr.name, res->res_job.JobType,
- level_to_str(res->res_job.JobLevel), res->res_job.Priority,
- res->res_job.MaxConcurrentJobs);
+ res->res_job.hdr.name, res->res_job.JobType,
+ level_to_str(res->res_job.JobLevel), res->res_job.Priority,
+ res->res_job.MaxConcurrentJobs);
sendit(sock, " Resched=%d Times=%d Interval=%s Spool=%d\n",
- res->res_job.RescheduleOnError, res->res_job.RescheduleTimes,
- edit_uint64_with_commas(res->res_job.RescheduleInterval, ed1),
- res->res_job.spool_data);
+ res->res_job.RescheduleOnError, res->res_job.RescheduleTimes,
+ edit_uint64_with_commas(res->res_job.RescheduleInterval, ed1),
+ res->res_job.spool_data);
if (res->res_job.client) {
sendit(sock, " --> ");
- dump_resource(-R_CLIENT, (RES *)res->res_job.client, sendit, sock);
+ dump_resource(-R_CLIENT, (RES *)res->res_job.client, sendit, sock);
}
if (res->res_job.fileset) {
sendit(sock, " --> ");
- dump_resource(-R_FILESET, (RES *)res->res_job.fileset, sendit, sock);
+ dump_resource(-R_FILESET, (RES *)res->res_job.fileset, sendit, sock);
}
if (res->res_job.schedule) {
sendit(sock, " --> ");
- dump_resource(-R_SCHEDULE, (RES *)res->res_job.schedule, sendit, sock);
+ dump_resource(-R_SCHEDULE, (RES *)res->res_job.schedule, sendit, sock);
}
if (res->res_job.RestoreWhere) {
sendit(sock, " --> Where=%s\n", NPRT(res->res_job.RestoreWhere));
}
if (res->res_job.storage[0]) {
sendit(sock, " --> ");
- /* ***FIXME*** */
-// dump_resource(-R_STORAGE, (RES *)res->res_job.storage, sendit, sock);
+ /* ***FIXME*** */
+// dump_resource(-R_STORAGE, (RES *)res->res_job.storage, sendit, sock);
}
if (res->res_job.pool) {
sendit(sock, " --> ");
- dump_resource(-R_POOL, (RES *)res->res_job.pool, sendit, sock);
+ dump_resource(-R_POOL, (RES *)res->res_job.pool, sendit, sock);
}
if (res->res_job.full_pool) {
sendit(sock, " --> ");
- dump_resource(-R_POOL, (RES *)res->res_job.full_pool, sendit, sock);
+ dump_resource(-R_POOL, (RES *)res->res_job.full_pool, sendit, sock);
}
if (res->res_job.inc_pool) {
sendit(sock, " --> ");
- dump_resource(-R_POOL, (RES *)res->res_job.inc_pool, sendit, sock);
+ dump_resource(-R_POOL, (RES *)res->res_job.inc_pool, sendit, sock);
}
if (res->res_job.dif_pool) {
sendit(sock, " --> ");
- dump_resource(-R_POOL, (RES *)res->res_job.dif_pool, sendit, sock);
+ dump_resource(-R_POOL, (RES *)res->res_job.dif_pool, sendit, sock);
}
if (res->res_job.verify_job) {
sendit(sock, " --> ");
- dump_resource(-type, (RES *)res->res_job.verify_job, sendit, sock);
+ dump_resource(-type, (RES *)res->res_job.verify_job, sendit, sock);
}
break;
if (res->res_job.messages) {
sendit(sock, " --> ");
- dump_resource(-R_MSGS, (RES *)res->res_job.messages, sendit, sock);
+ dump_resource(-R_MSGS, (RES *)res->res_job.messages, sendit, sock);
}
break;
case R_FILESET:
int i, j, k;
sendit(sock, "FileSet: name=%s\n", res->res_fs.hdr.name);
for (i=0; i<res->res_fs.num_includes; i++) {
- INCEXE *incexe = res->res_fs.include_items[i];
- for (j=0; j<incexe->num_opts; j++) {
- FOPTS *fo = incexe->opts_list[j];
+ INCEXE *incexe = res->res_fs.include_items[i];
+ for (j=0; j<incexe->num_opts; j++) {
+ FOPTS *fo = incexe->opts_list[j];
sendit(sock, " O %s\n", fo->opts);
- for (k=0; k<fo->regex.size(); k++) {
+ for (k=0; k<fo->regex.size(); k++) {
sendit(sock, " R %s\n", fo->regex.get(k));
- }
- for (k=0; k<fo->wild.size(); k++) {
+ }
+ for (k=0; k<fo->regexdir.size(); k++) {
+ sendit(sock, " RD %s\n", fo->regexdir.get(k));
+ }
+ for (k=0; k<fo->regexfile.size(); k++) {
+ sendit(sock, " RF %s\n", fo->regexfile.get(k));
+ }
+ for (k=0; k<fo->wild.size(); k++) {
sendit(sock, " W %s\n", fo->wild.get(k));
- }
- for (k=0; k<fo->base.size(); k++) {
+ }
+ for (k=0; k<fo->wilddir.size(); k++) {
+ sendit(sock, " WD %s\n", fo->wilddir.get(k));
+ }
+ for (k=0; k<fo->wildfile.size(); k++) {
+ sendit(sock, " WF %s\n", fo->wildfile.get(k));
+ }
+ for (k=0; k<fo->base.size(); k++) {
sendit(sock, " B %s\n", fo->base.get(k));
- }
- if (fo->reader) {
+ }
+ for (k=0; k<fo->fstype.size(); k++) {
+ sendit(sock, " X %s\n", fo->fstype.get(k));
+ }
+ if (fo->reader) {
sendit(sock, " D %s\n", fo->reader);
- }
- if (fo->writer) {
+ }
+ if (fo->writer) {
sendit(sock, " T %s\n", fo->writer);
- }
+ }
sendit(sock, " N\n");
- }
- for (j=0; j<incexe->name_list.size(); j++) {
+ }
+ for (j=0; j<incexe->name_list.size(); j++) {
sendit(sock, " I %s\n", incexe->name_list.get(j));
- }
- if (incexe->name_list.size()) {
+ }
+ if (incexe->name_list.size()) {
sendit(sock, " N\n");
- }
+ }
}
-
+
for (i=0; i<res->res_fs.num_excludes; i++) {
- INCEXE *incexe = res->res_fs.exclude_items[i];
- for (j=0; j<incexe->name_list.size(); j++) {
+ INCEXE *incexe = res->res_fs.exclude_items[i];
+ for (j=0; j<incexe->name_list.size(); j++) {
sendit(sock, " E %s\n", incexe->name_list.get(j));
- }
- if (incexe->name_list.size()) {
+ }
+ if (incexe->name_list.size()) {
sendit(sock, " N\n");
- }
+ }
}
break;
}
case R_SCHEDULE:
if (res->res_sch.run) {
- int i;
- RUN *run = res->res_sch.run;
- char buf[1000], num[30];
+ int i;
+ RUN *run = res->res_sch.run;
+ char buf[1000], num[30];
sendit(sock, "Schedule: name=%s\n", res->res_sch.hdr.name);
- if (!run) {
- break;
- }
+ if (!run) {
+ break;
+ }
next_run:
sendit(sock, " --> Run Level=%s\n", level_to_str(run->level));
bstrncpy(buf, " hour=", sizeof(buf));
- for (i=0; i<24; i++) {
- if (bit_is_set(i, run->hour)) {
+ for (i=0; i<24; i++) {
+ if (bit_is_set(i, run->hour)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
bstrncpy(buf, " mday=", sizeof(buf));
- for (i=0; i<31; i++) {
- if (bit_is_set(i, run->mday)) {
+ for (i=0; i<31; i++) {
+ if (bit_is_set(i, run->mday)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
bstrncpy(buf, " month=", sizeof(buf));
- for (i=0; i<12; i++) {
- if (bit_is_set(i, run->month)) {
+ for (i=0; i<12; i++) {
+ if (bit_is_set(i, run->month)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
bstrncpy(buf, " wday=", sizeof(buf));
- for (i=0; i<7; i++) {
- if (bit_is_set(i, run->wday)) {
+ for (i=0; i<7; i++) {
+ if (bit_is_set(i, run->wday)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
bstrncpy(buf, " wom=", sizeof(buf));
- for (i=0; i<5; i++) {
- if (bit_is_set(i, run->wom)) {
+ for (i=0; i<5; i++) {
+ if (bit_is_set(i, run->wom)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
bstrncpy(buf, " woy=", sizeof(buf));
- for (i=0; i<54; i++) {
- if (bit_is_set(i, run->woy)) {
+ for (i=0; i<54; i++) {
+ if (bit_is_set(i, run->woy)) {
bsnprintf(num, sizeof(num), "%d ", i);
- bstrncat(buf, num, sizeof(buf));
- }
- }
+ bstrncat(buf, num, sizeof(buf));
+ }
+ }
bstrncat(buf, "\n", sizeof(buf));
- sendit(sock, buf);
+ sendit(sock, buf);
sendit(sock, " mins=%d\n", run->minute);
- if (run->pool) {
+ if (run->pool) {
sendit(sock, " --> ");
- dump_resource(-R_POOL, (RES *)run->pool, sendit, sock);
- }
- if (run->storage) {
+ dump_resource(-R_POOL, (RES *)run->pool, sendit, sock);
+ }
+ if (run->storage) {
sendit(sock, " --> ");
- dump_resource(-R_STORAGE, (RES *)run->storage, sendit, sock);
- }
- if (run->msgs) {
+ dump_resource(-R_STORAGE, (RES *)run->storage, sendit, sock);
+ }
+ if (run->msgs) {
sendit(sock, " --> ");
- dump_resource(-R_MSGS, (RES *)run->msgs, sendit, sock);
- }
- /* If another Run record is chained in, go print it */
- if (run->next) {
- run = run->next;
- goto next_run;
- }
+ dump_resource(-R_MSGS, (RES *)run->msgs, sendit, sock);
+ }
+ /* If another Run record is chained in, go print it */
+ if (run->next) {
+ run = run->next;
+ goto next_run;
+ }
} else {
sendit(sock, "Schedule: name=%s\n", res->res_sch.hdr.name);
}
break;
case R_POOL:
sendit(sock, "Pool: name=%s PoolType=%s\n", res->res_pool.hdr.name,
- res->res_pool.pool_type);
+ res->res_pool.pool_type);
sendit(sock, " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n",
- res->res_pool.use_catalog, res->res_pool.use_volume_once,
- res->res_pool.accept_any_volume, res->res_pool.catalog_files);
+ res->res_pool.use_catalog, res->res_pool.use_volume_once,
+ res->res_pool.accept_any_volume, res->res_pool.catalog_files);
sendit(sock, " max_vols=%d auto_prune=%d VolRetention=%s\n",
- res->res_pool.max_volumes, res->res_pool.AutoPrune,
- edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
+ res->res_pool.max_volumes, res->res_pool.AutoPrune,
+ edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
sendit(sock, " VolUse=%s recycle=%d LabelFormat=%s\n",
- edit_utime(res->res_pool.VolUseDuration, ed1, sizeof(ed1)),
- res->res_pool.Recycle,
- NPRT(res->res_pool.label_format));
+ edit_utime(res->res_pool.VolUseDuration, ed1, sizeof(ed1)),
+ res->res_pool.Recycle,
+ NPRT(res->res_pool.label_format));
sendit(sock, " CleaningPrefix=%s\n",
- NPRT(res->res_pool.cleaning_prefix));
+ NPRT(res->res_pool.cleaning_prefix));
sendit(sock, " recyleOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n",
- res->res_pool.purge_oldest_volume,
- res->res_pool.MaxVolJobs, res->res_pool.MaxVolFiles);
+ res->res_pool.purge_oldest_volume,
+ res->res_pool.MaxVolJobs, res->res_pool.MaxVolFiles);
break;
case R_MSGS:
sendit(sock, "Messages: name=%s\n", res->res_msgs.hdr.name);
for (int i=0; i<incexe->num_opts; i++) {
FOPTS *fopt = incexe->opts_list[i];
fopt->regex.destroy();
+ fopt->regexdir.destroy();
+ fopt->regexfile.destroy();
fopt->wild.destroy();
+ fopt->wilddir.destroy();
+ fopt->wildfile.destroy();
fopt->base.destroy();
+ fopt->fstype.destroy();
if (fopt->reader) {
- free(fopt->reader);
+ free(fopt->reader);
}
if (fopt->writer) {
- free(fopt->writer);
+ free(fopt->writer);
}
free(fopt);
}
void free_resource(RES *sres, int type)
{
int num;
- RES *nres; /* next resource if linked */
+ RES *nres; /* next resource if linked */
URES *res = (URES *)sres;
if (res == NULL)
switch (type) {
case R_DIRECTOR:
if (res->res_dir.working_directory) {
- free(res->res_dir.working_directory);
+ free(res->res_dir.working_directory);
}
if (res->res_dir.pid_directory) {
- free(res->res_dir.pid_directory);
+ free(res->res_dir.pid_directory);
}
if (res->res_dir.subsys_directory) {
- free(res->res_dir.subsys_directory);
+ free(res->res_dir.subsys_directory);
}
if (res->res_dir.password) {
- free(res->res_dir.password);
+ free(res->res_dir.password);
}
if (res->res_dir.query_file) {
- free(res->res_dir.query_file);
+ free(res->res_dir.query_file);
}
if (res->res_dir.DIRaddrs) {
- free_addresses(res->res_dir.DIRaddrs);
+ free_addresses(res->res_dir.DIRaddrs);
}
break;
case R_COUNTER:
break;
case R_CONSOLE:
if (res->res_con.password) {
- free(res->res_con.password);
+ free(res->res_con.password);
}
for (int i=0; i<Num_ACL; i++) {
- if (res->res_con.ACL_lists[i]) {
- delete res->res_con.ACL_lists[i];
- res->res_con.ACL_lists[i] = NULL;
- }
+ if (res->res_con.ACL_lists[i]) {
+ delete res->res_con.ACL_lists[i];
+ res->res_con.ACL_lists[i] = NULL;
+ }
}
break;
case R_CLIENT:
if (res->res_client.address) {
- free(res->res_client.address);
+ free(res->res_client.address);
}
if (res->res_client.password) {
- free(res->res_client.password);
+ free(res->res_client.password);
}
break;
case R_STORAGE:
if (res->res_store.address) {
- free(res->res_store.address);
+ free(res->res_store.address);
}
if (res->res_store.password) {
- free(res->res_store.password);
+ free(res->res_store.password);
}
if (res->res_store.media_type) {
- free(res->res_store.media_type);
+ free(res->res_store.media_type);
}
if (res->res_store.dev_name) {
- free(res->res_store.dev_name);
+ free(res->res_store.dev_name);
}
break;
case R_CATALOG:
if (res->res_cat.db_address) {
- free(res->res_cat.db_address);
+ free(res->res_cat.db_address);
}
if (res->res_cat.db_socket) {
- free(res->res_cat.db_socket);
+ free(res->res_cat.db_socket);
}
if (res->res_cat.db_user) {
- free(res->res_cat.db_user);
+ free(res->res_cat.db_user);
}
if (res->res_cat.db_name) {
- free(res->res_cat.db_name);
+ free(res->res_cat.db_name);
}
if (res->res_cat.db_password) {
- free(res->res_cat.db_password);
+ free(res->res_cat.db_password);
}
break;
case R_FILESET:
if ((num=res->res_fs.num_includes)) {
- while (--num >= 0) {
- free_incexe(res->res_fs.include_items[num]);
- }
- free(res->res_fs.include_items);
+ while (--num >= 0) {
+ free_incexe(res->res_fs.include_items[num]);
+ }
+ free(res->res_fs.include_items);
}
res->res_fs.num_includes = 0;
if ((num=res->res_fs.num_excludes)) {
- while (--num >= 0) {
- free_incexe(res->res_fs.exclude_items[num]);
- }
- free(res->res_fs.exclude_items);
+ while (--num >= 0) {
+ free_incexe(res->res_fs.exclude_items[num]);
+ }
+ free(res->res_fs.exclude_items);
}
res->res_fs.num_excludes = 0;
break;
case R_POOL:
if (res->res_pool.pool_type) {
- free(res->res_pool.pool_type);
+ free(res->res_pool.pool_type);
}
if (res->res_pool.label_format) {
- free(res->res_pool.label_format);
+ free(res->res_pool.label_format);
}
if (res->res_pool.cleaning_prefix) {
- free(res->res_pool.cleaning_prefix);
+ free(res->res_pool.cleaning_prefix);
}
break;
case R_SCHEDULE:
if (res->res_sch.run) {
- RUN *nrun, *next;
- nrun = res->res_sch.run;
- while (nrun) {
- next = nrun->next;
- free(nrun);
- nrun = next;
- }
+ RUN *nrun, *next;
+ nrun = res->res_sch.run;
+ while (nrun) {
+ next = nrun->next;
+ free(nrun);
+ nrun = next;
+ }
}
break;
case R_JOB:
case R_JOBDEFS:
if (res->res_job.RestoreWhere) {
- free(res->res_job.RestoreWhere);
+ free(res->res_job.RestoreWhere);
}
if (res->res_job.RestoreBootstrap) {
- free(res->res_job.RestoreBootstrap);
+ free(res->res_job.RestoreBootstrap);
}
if (res->res_job.WriteBootstrap) {
- free(res->res_job.WriteBootstrap);
+ free(res->res_job.WriteBootstrap);
}
if (res->res_job.RunBeforeJob) {
- free(res->res_job.RunBeforeJob);
+ free(res->res_job.RunBeforeJob);
}
if (res->res_job.RunAfterJob) {
- free(res->res_job.RunAfterJob);
+ free(res->res_job.RunAfterJob);
}
if (res->res_job.RunAfterFailedJob) {
- free(res->res_job.RunAfterFailedJob);
+ free(res->res_job.RunAfterFailedJob);
}
if (res->res_job.ClientRunBeforeJob) {
- free(res->res_job.ClientRunBeforeJob);
+ free(res->res_job.ClientRunBeforeJob);
}
if (res->res_job.ClientRunAfterJob) {
- free(res->res_job.ClientRunAfterJob);
+ free(res->res_job.ClientRunAfterJob);
}
for (int i=0; i < MAX_STORE; i++) {
- if (res->res_job.storage[i]) {
- delete (alist *)res->res_job.storage[i];
- }
+ if (res->res_job.storage[i]) {
+ delete (alist *)res->res_job.storage[i];
+ }
}
break;
case R_MSGS:
if (res->res_msgs.mail_cmd) {
- free(res->res_msgs.mail_cmd);
+ free(res->res_msgs.mail_cmd);
}
if (res->res_msgs.operator_cmd) {
- free(res->res_msgs.operator_cmd);
+ free(res->res_msgs.operator_cmd);
}
free_msgs_res((MSGS *)res); /* free message resource */
res = NULL;
* Ensure that all required items are present
*/
for (i=0; items[i].name; i++) {
- if (items[i].flags & ITEM_REQUIRED) {
- if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {
- Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
- items[i].name, resources[rindex]);
- }
- }
- /* If this triggers, take a look at lib/parse_conf.h */
- if (i >= MAX_RES_ITEMS) {
+ if (items[i].flags & ITEM_REQUIRED) {
+ if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {
+ Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+ items[i].name, resources[rindex]);
+ }
+ }
+ /* If this triggers, take a look at lib/parse_conf.h */
+ if (i >= MAX_RES_ITEMS) {
Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
- }
+ }
+ }
+ } else if (type == R_JOB) {
+ /*
+ * Ensure that the name item is present
+ */
+ if (items[0].flags & ITEM_REQUIRED) {
+ if (!bit_is_set(0, res_all.res_dir.hdr.item_present)) {
+ Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+ items[0].name, resources[rindex]);
+ }
}
}
case R_POOL:
case R_MSGS:
case R_FILESET:
- break;
+ break;
/* Resources containing another resource */
case R_DIRECTOR:
- if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) {
+ if ((res = (URES *)GetResWithName(R_DIRECTOR, res_all.res_dir.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Director resource %s\n", res_all.res_dir.hdr.name);
- }
- res->res_dir.messages = res_all.res_dir.messages;
- break;
+ }
+ res->res_dir.messages = res_all.res_dir.messages;
+ break;
case R_JOB:
case R_JOBDEFS:
- if ((res = (URES *)GetResWithName(type, res_all.res_dir.hdr.name)) == NULL) {
+ if ((res = (URES *)GetResWithName(type, res_all.res_dir.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Job resource %s\n",
- res_all.res_dir.hdr.name);
- }
- res->res_job.messages = res_all.res_job.messages;
- res->res_job.schedule = res_all.res_job.schedule;
- res->res_job.client = res_all.res_job.client;
- res->res_job.fileset = res_all.res_job.fileset;
- for (int i=0; i < MAX_STORE; i++) {
- res->res_job.storage[i] = res_all.res_job.storage[i];
- }
- res->res_job.pool = res_all.res_job.pool;
- res->res_job.full_pool = res_all.res_job.full_pool;
- res->res_job.inc_pool = res_all.res_job.inc_pool;
- res->res_job.dif_pool = res_all.res_job.dif_pool;
- res->res_job.verify_job = res_all.res_job.verify_job;
- res->res_job.jobdefs = res_all.res_job.jobdefs;
- break;
+ res_all.res_dir.hdr.name);
+ }
+ res->res_job.messages = res_all.res_job.messages;
+ res->res_job.schedule = res_all.res_job.schedule;
+ res->res_job.client = res_all.res_job.client;
+ res->res_job.fileset = res_all.res_job.fileset;
+ for (int i=0; i < MAX_STORE; i++) {
+ res->res_job.storage[i] = res_all.res_job.storage[i];
+ }
+ res->res_job.pool = res_all.res_job.pool;
+ res->res_job.full_pool = res_all.res_job.full_pool;
+ res->res_job.inc_pool = res_all.res_job.inc_pool;
+ res->res_job.dif_pool = res_all.res_job.dif_pool;
+ res->res_job.verify_job = res_all.res_job.verify_job;
+ res->res_job.jobdefs = res_all.res_job.jobdefs;
+ break;
case R_COUNTER:
- if ((res = (URES *)GetResWithName(R_COUNTER, res_all.res_counter.hdr.name)) == NULL) {
+ if ((res = (URES *)GetResWithName(R_COUNTER, res_all.res_counter.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Counter resource %s\n", res_all.res_counter.hdr.name);
- }
- res->res_counter.Catalog = res_all.res_counter.Catalog;
- res->res_counter.WrapCounter = res_all.res_counter.WrapCounter;
- break;
+ }
+ res->res_counter.Catalog = res_all.res_counter.Catalog;
+ res->res_counter.WrapCounter = res_all.res_counter.WrapCounter;
+ break;
case R_CLIENT:
- if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_client.hdr.name)) == NULL) {
+ if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_client.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Client resource %s\n", res_all.res_client.hdr.name);
- }
- res->res_client.catalog = res_all.res_client.catalog;
- break;
+ }
+ res->res_client.catalog = res_all.res_client.catalog;
+ break;
case R_SCHEDULE:
- /*
- * Schedule is a bit different in that it contains a RUN record
+ /*
+ * Schedule is a bit different in that it contains a RUN record
* chain which isn't a "named" resource. This chain was linked
- * in by run_conf.c during pass 2, so here we jam the pointer
- * into the Schedule resource.
- */
- if ((res = (URES *)GetResWithName(R_SCHEDULE, res_all.res_client.hdr.name)) == NULL) {
+ * in by run_conf.c during pass 2, so here we jam the pointer
+ * into the Schedule resource.
+ */
+ if ((res = (URES *)GetResWithName(R_SCHEDULE, res_all.res_client.hdr.name)) == NULL) {
Emsg1(M_ERROR_TERM, 0, "Cannot find Schedule resource %s\n", res_all.res_client.hdr.name);
- }
- res->res_sch.run = res_all.res_sch.run;
- break;
+ }
+ res->res_sch.run = res_all.res_sch.run;
+ break;
default:
Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
- error = 1;
- break;
+ error = 1;
+ break;
}
/* Note, the resource name was already saved during pass 1,
* so here, we can just release it.
*/
if (res_all.res_dir.hdr.name) {
- free(res_all.res_dir.hdr.name);
- res_all.res_dir.hdr.name = NULL;
+ free(res_all.res_dir.hdr.name);
+ res_all.res_dir.hdr.name = NULL;
}
if (res_all.res_dir.hdr.desc) {
- free(res_all.res_dir.hdr.desc);
- res_all.res_dir.hdr.desc = NULL;
+ free(res_all.res_dir.hdr.desc);
+ res_all.res_dir.hdr.desc = NULL;
}
return;
}
res = (URES *)malloc(size);
memcpy(res, &res_all, size);
if (!res_head[rindex]) {
- res_head[rindex] = (RES *)res; /* store first entry */
+ res_head[rindex] = (RES *)res; /* store first entry */
Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
- res->res_dir.hdr.name, rindex);
+ res->res_dir.hdr.name, rindex);
} else {
- RES *next;
- /* Add new res to end of chain */
- for (next=res_head[rindex]; next->next; next=next->next) {
- if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
- Emsg2(M_ERROR_TERM, 0,
+ RES *next;
+ /* Add new res to end of chain */
+ for (next=res_head[rindex]; next->next; next=next->next) {
+ if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
+ Emsg2(M_ERROR_TERM, 0,
_("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
- resources[rindex].name, res->res_dir.hdr.name);
- }
- }
- next->next = (RES *)res;
+ resources[rindex].name, res->res_dir.hdr.name);
+ }
+ }
+ next->next = (RES *)res;
Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
- res->res_dir.hdr.name, rindex, pass);
+ res->res_dir.hdr.name, rindex, pass);
}
}
}
/* Store the type both pass 1 and pass 2 */
for (i=0; jobtypes[i].type_name; i++) {
if (strcasecmp(lc->str, jobtypes[i].type_name) == 0) {
- *(int *)(item->value) = jobtypes[i].job_type;
- i = 0;
- break;
+ *(int *)(item->value) = jobtypes[i].job_type;
+ i = 0;
+ break;
}
}
if (i != 0) {
/* Store the level pass 2 so that type is defined */
for (i=0; joblevels[i].level_name; i++) {
if (strcasecmp(lc->str, joblevels[i].level_name) == 0) {
- *(int *)(item->value) = joblevels[i].level;
- i = 0;
- break;
+ *(int *)(item->value) = joblevels[i].level;
+ i = 0;
+ break;
}
}
if (i != 0) {
/* Scan Replacement options */
for (i=0; ReplaceOptions[i].name; i++) {
if (strcasecmp(lc->str, ReplaceOptions[i].name) == 0) {
- *(int *)(item->value) = ReplaceOptions[i].token;
- i = 0;
- break;
+ *(int *)(item->value) = ReplaceOptions[i].token;
+ i = 0;
+ break;
}
}
if (i != 0) {
for (;;) {
token = lex_get_token(lc, T_NAME);
if (pass == 1) {
- if (((alist **)item->value)[item->code] == NULL) {
- ((alist **)item->value)[item->code] = New(alist(10, owned_by_alist));
+ if (((alist **)item->value)[item->code] == NULL) {
+ ((alist **)item->value)[item->code] = New(alist(10, owned_by_alist));
Dmsg1(900, "Defined new ACL alist at %d\n", item->code);
- }
- ((alist **)item->value)[item->code]->append(bstrdup(lc->str));
+ }
+ ((alist **)item->value)[item->code]->append(bstrdup(lc->str));
Dmsg2(900, "Appended to %d %s\n", item->code, lc->str);
}
token = lex_get_token(lc, T_ALL);
if (token == T_COMMA) {
- continue; /* get another ACL */
+ continue; /* get another ACL */
}
break;
}
};
#undef MAX_FOPTS
-#define MAX_FOPTS 30
+#define MAX_FOPTS 34
/* File options structure */
struct FOPTS {
char opts[MAX_FOPTS]; /* options string */
alist regex; /* regex string(s) */
+ alist regexdir; /* regex string(s) for directories */
+ alist regexfile; /* regex string(s) for files */
alist wild; /* wild card strings */
+ alist wilddir; /* wild card strings for directories */
+ alist wildfile; /* wild card strings for files */
alist base; /* list of base names */
+ alist fstype; /* file system type limitation */
char *reader; /* reader program */
char *writer; /* writer program */
};
*
* This routine is run as a separate thread. There may be more
* work to be done to make it totally reentrant!!!!
- *
+ *
* Utility functions for sending info to File Daemon.
* These functions are used by both backup and verify.
- *
+ *
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* External functions */
extern int debug_level;
-extern DIRRES *director;
+extern DIRRES *director;
extern int FDConnectTimeout;
#define INC_LIST 0
#define EXC_LIST 1
/*
- * Open connection with File daemon.
+ * Open connection with File daemon.
* Try connecting every retry_interval (default 10 sec), and
* give up after max_retry_time (default 30 mins).
*/
if (!jcr->file_bsock) {
fd = bnet_connect(jcr, retry_interval, max_retry_time,
- _("File daemon"), jcr->client->address,
+ _("File daemon"), jcr->client->address,
NULL, jcr->client->FDport, verbose);
if (fd == NULL) {
set_jcr_job_status(jcr, JS_ErrorTerminated);
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
}
-
+
/*
* Now send JobId and authorization key
*/
- bnet_fsend(fd, jobcmd, jcr->JobId, jcr->Job, jcr->VolSessionId,
+ bnet_fsend(fd, jobcmd, jcr->JobId, jcr->Job, jcr->VolSessionId,
jcr->VolSessionTime, jcr->sd_auth_key);
if (strcmp(jcr->sd_auth_key, "dummy") != 0) {
memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key));
if (bget_dirmsg(fd) > 0) {
Dmsg1(110, "<filed: %s", fd->msg);
if (strncmp(fd->msg, OKjob, strlen(OKjob)) != 0) {
- Jmsg(jcr, M_FATAL, 0, _("File daemon \"%s\" rejected Job command: %s\n"),
+ Jmsg(jcr, M_FATAL, 0, _("File daemon \"%s\" rejected Job command: %s\n"),
jcr->client->hdr.name, fd->msg);
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
/*
* This subroutine edits the last job start time into a
- * "since=date/time" buffer that is returned in the
+ * "since=date/time" buffer that is returned in the
* variable since. This is used for display purposes in
- * the job report. The time in jcr->stime is later
+ * the job report. The time in jcr->stime is later
* passed to tell the File daemon what to do.
*/
void get_level_since_time(JCR *jcr, char *since, int since_len)
{
int JobLevel;
- /* Lookup the last FULL backup job to get the time/date for a
+ /* Lookup the last FULL backup job to get the time/date for a
* differential or incremental save.
*/
if (!jcr->stime) {
/* No job found, so upgrade this one to Full */
Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db));
Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found. Doing FULL backup.\n"));
- bsnprintf(since, since_len, " (upgraded from %s)",
+ bsnprintf(since, since_len, " (upgraded from %s)",
level_to_str(jcr->JobLevel));
jcr->JobLevel = jcr->jr.JobLevel = L_FULL;
} else {
if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr, jcr->stime, JobLevel)) {
Jmsg(jcr, M_INFO, 0, _("Prior failed job found. Upgrading to %s.\n"),
level_to_str(JobLevel));
- bsnprintf(since, since_len, " (upgraded from %s)",
+ bsnprintf(since, since_len, " (upgraded from %s)",
level_to_str(jcr->JobLevel));
jcr->JobLevel = jcr->jr.JobLevel = JobLevel;
jcr->jr.JobId = jcr->JobId;
break;
}
- }
+ }
bstrncpy(since, ", since=", since_len);
bstrncat(since, jcr->stime, since_len);
}
/*
- * Send level command to FD.
+ * Send level command to FD.
* Used for backup jobs and estimate command.
*/
-int send_level_command(JCR *jcr)
+int send_level_command(JCR *jcr)
{
BSOCK *fd = jcr->file_bsock;
utime_t stime;
char ed1[50];
- /*
+ /*
* Send Level command to File daemon
*/
switch (jcr->JobLevel) {
break;
case L_SINCE:
default:
- Jmsg2(jcr, M_FATAL, 0, _("Unimplemented backup level %d %c\n"),
+ Jmsg2(jcr, M_FATAL, 0, _("Unimplemented backup level %d %c\n"),
jcr->JobLevel, jcr->JobLevel);
return 0;
}
num = fileset->num_includes;
} else {
num = fileset->num_excludes;
- }
+ }
for (int i=0; i<num; i++) {
BPIPE *bpipe;
FILE *ffd;
} else {
ie = fileset->exclude_items[i];
bnet_fsend(fd, "E\n");
- }
+ }
for (j=0; j<ie->num_opts; j++) {
FOPTS *fo = ie->opts_list[j];
bnet_fsend(fd, "O %s\n", fo->opts);
for (k=0; k<fo->regex.size(); k++) {
bnet_fsend(fd, "R %s\n", fo->regex.get(k));
}
+ for (k=0; k<fo->regexdir.size(); k++) {
+ bnet_fsend(fd, "RD %s\n", fo->regexdir.get(k));
+ }
+ for (k=0; k<fo->regexfile.size(); k++) {
+ bnet_fsend(fd, "RF %s\n", fo->regexfile.get(k));
+ }
for (k=0; k<fo->wild.size(); k++) {
bnet_fsend(fd, "W %s\n", fo->wild.get(k));
}
+ for (k=0; k<fo->wilddir.size(); k++) {
+ bnet_fsend(fd, "WD %s\n", fo->wilddir.get(k));
+ }
+ for (k=0; k<fo->wildfile.size(); k++) {
+ bnet_fsend(fd, "WF %s\n", fo->wildfile.get(k));
+ }
for (k=0; k<fo->base.size(); k++) {
bnet_fsend(fd, "B %s\n", fo->base.get(k));
}
+ for (k=0; k<fo->fstype.size(); k++) {
+ bnet_fsend(fd, "X %s\n", fo->fstype.get(k));
+ }
if (fo->reader) {
bnet_fsend(fd, "D %s\n", fo->reader);
}
/*
- * Send exclude list to File daemon
+ * Send exclude list to File daemon
*/
int send_exclude_list(JCR *jcr)
{
bs = fopen(jcr->RestoreBootstrap, "r");
if (!bs) {
berrno be;
- Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
+ Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
jcr->RestoreBootstrap, be.strerror());
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
}
bnet_fsend(fd, bootstrap);
while (fgets(buf, sizeof(buf), bs)) {
- bnet_fsend(fd, "%s", buf);
+ bnet_fsend(fd, "%s", buf);
}
bnet_sig(fd, BNET_EOD);
fclose(bs);
}
-/*
+/*
* Read the attributes from the File daemon for
* a Verify job and store them in the catalog.
*/
/* Pickup file attributes and signature */
while (!fd->errors && (n = bget_dirmsg(fd)) > 0) {
- /*****FIXME****** improve error handling to stop only on
+ /*****FIXME****** improve error handling to stop only on
* really fatal problems, or the number of errors is too
* large.
*/
jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen);
if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Opts_SIG)) != 3) {
- Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got %d\n\
-msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
+ Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got %d\n"
+"msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
}
skip_spaces(&p);
skip_nonspaces(&p); /* skip Stream */
skip_spaces(&p);
- skip_nonspaces(&p); /* skip Opts_SHA1 */
+ skip_nonspaces(&p); /* skip Opts_SHA1 */
p++; /* skip space */
fn = jcr->fname;
while (*p != 0) {
}
db_escape_string(SIG, Opts_SIG, strlen(Opts_SIG));
Dmsg2(120, "SIGlen=%d SIG=%s\n", strlen(SIG), SIG);
- if (!db_add_SIG_to_file_record(jcr, jcr->db, jcr->FileId, SIG,
+ if (!db_add_SIG_to_file_record(jcr, jcr->db, jcr->FileId, SIG,
stream==STREAM_MD5_SIGNATURE?MD5_SIG:SHA1_SIG)) {
Jmsg1(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
set_jcr_job_status(jcr, JS_Error);
}
jcr->jr.JobFiles = jcr->JobFiles = file_index;
jcr->jr.LastIndex = file_index;
- }
+ }
if (is_bnet_error(fd)) {
Jmsg1(jcr, M_FATAL, 0, _("<filed: Network error getting attributes. ERR=%s\n"),
bnet_strerror(fd));
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* Forward referenced functions */
static char *find_msg_start(char *msg);
+static char Job_status[] = "Status Job=%127s JobStatus=%d\n";
+
static char OK_msg[] = "1000 OK\n";
/*
free_jcr(jcr);
continue;
}
+ if (bs->msg[0] == 'S') { /* Status change */
+ int JobStatus;
+ char Job[MAX_NAME_LENGTH];
+ if (sscanf(bs->msg, Job_status, &Job, &JobStatus) == 2) {
+ jcr->SDJobStatus = JobStatus; /* current status */
+ free_jcr(jcr);
+ continue;
+ }
+ }
return n;
}
}
* Version $Id$
*/
/*
- Copyright (C) 2003-2004 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass);
static void store_regex(LEX *lc, RES_ITEM *item, int index, int pass);
static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass);
+static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass);
static void store_opts(LEX *lc, RES_ITEM *item, int index, int pass);
static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass);
static void options_res(LEX *lc, RES_ITEM *item, int index, int pass);
/* We build the current new Include and Exclude items here */
static INCEXE res_incexe;
-/*
+/*
* new Include/Exclude items
* name handler value code flags default_value
*/
static RES_ITEM newinc_items[] = {
{"file", store_fname, NULL, 0, 0, 0},
{"options", options_res, NULL, 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, NULL, 0, 0, 0}
};
/*
{"onefs", store_opts, NULL, 0, 0, 0},
{"recurse", store_opts, NULL, 0, 0, 0},
{"sparse", store_opts, NULL, 0, 0, 0},
+ {"hardlinks", store_opts, NULL, 0, 0, 0},
{"readfifo", store_opts, NULL, 0, 0, 0},
{"replace", store_opts, NULL, 0, 0, 0},
{"portable", store_opts, NULL, 0, 0, 0},
{"mtimeonly", store_opts, NULL, 0, 0, 0},
{"keepatime", store_opts, NULL, 0, 0, 0},
{"regex", store_regex, NULL, 0, 0, 0},
+ {"regexdir", store_regex, NULL, 1, 0, 0},
+ {"regexfile", store_regex, NULL, 2, 0, 0},
{"base", store_base, NULL, 0, 0, 0},
{"wild", store_wild, NULL, 0, 0, 0},
+ {"wilddir", store_wild, NULL, 1, 0, 0},
+ {"wildfile", store_wild, NULL, 2, 0, 0},
{"exclude", store_opts, NULL, 0, 0, 0},
{"aclsupport", store_opts, NULL, 0, 0, 0},
{"reader", store_reader, NULL, 0, 0, 0},
{"writer", store_writer, NULL, 0, 0, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {"ignorecase", store_opts, NULL, 0, 0, 0},
+ {"fstype", store_fstype, NULL, 0, 0, 0},
+ {"hfsplussupport", store_opts, NULL, 0, 0, 0},
+ {NULL, NULL, NULL, 0, 0, 0}
};
INC_KW_ONEFS,
INC_KW_RECURSE,
INC_KW_SPARSE,
+ INC_KW_HARDLINK,
INC_KW_REPLACE, /* restore options */
INC_KW_READFIFO, /* Causes fifo data to be read */
INC_KW_PORTABLE,
INC_KW_MTIMEONLY,
INC_KW_KEEPATIME,
INC_KW_EXCLUDE,
- INC_KW_ACL
+ INC_KW_ACL,
+ INC_KW_IGNORECASE,
+ INC_KW_HFSPLUS
};
/*
{"onefs", INC_KW_ONEFS},
{"recurse", INC_KW_RECURSE},
{"sparse", INC_KW_SPARSE},
+ {"hardlinks", INC_KW_HARDLINK},
{"replace", INC_KW_REPLACE},
{"readfifo", INC_KW_READFIFO},
{"portable", INC_KW_PORTABLE},
{"keepatime", INC_KW_KEEPATIME},
{"exclude", INC_KW_EXCLUDE},
{"aclsupport", INC_KW_ACL},
+ {"ignorecase", INC_KW_IGNORECASE},
+ {"hfsplussupport", INC_KW_HFSPLUS},
{NULL, 0}
};
};
/*
- * Options permitted for each keyword and resulting value.
+ * Options permitted for each keyword and resulting value.
* The output goes into opts, which are then transmitted to
* the FD for application as options to the following list of
* included files.
{"no", INC_KW_RECURSE, "h"},
{"yes", INC_KW_SPARSE, "s"},
{"no", INC_KW_SPARSE, "0"},
+ {"yes", INC_KW_HARDLINK, "0"},
+ {"no", INC_KW_HARDLINK, "H"},
{"always", INC_KW_REPLACE, "a"},
{"ifnewer", INC_KW_REPLACE, "w"},
{"never", INC_KW_REPLACE, "n"},
{"no", INC_KW_EXCLUDE, "0"},
{"yes", INC_KW_ACL, "A"},
{"no", INC_KW_ACL, "0"},
+ {"yes", INC_KW_IGNORECASE, "i"},
+ {"no", INC_KW_IGNORECASE, "0"},
+ {"yes", INC_KW_HFSPLUS, "R"}, /* "R" for resource fork */
+ {"no", INC_KW_HFSPLUS, "0"},
{NULL, 0, 0}
};
-/*
- * Scan for right hand side of Include options (keyword=option) is
+/*
+ * Scan for right hand side of Include options (keyword=option) is
* converted into one or two characters. Verifyopts=xxxx is Vxxxx:
* Whatever is found is concatenated to the opts string.
* This code is also used inside an Options resource.
{
int token, i;
char option[3];
+ int lcopts = lc->options;
option[0] = 0; /* default option = none */
option[2] = 0; /* terminate options */
- token = lex_get_token(lc, T_NAME); /* expect at least one option */
+ lc->options |= LOPT_STRING; /* force string */
+ token = lex_get_token(lc, T_STRING); /* expect at least one option */
if (keyword == INC_KW_VERIFY) { /* special case */
/* ***FIXME**** ensure these are in permitted set */
bstrncat(opts, "V", optlen); /* indicate Verify */
Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
/*
- * Standard keyword options for Include/Exclude
+ * Standard keyword options for Include/Exclude
*/
} else {
for (i=0; FS_options[i].name; i++) {
Dmsg3(900, "Catopts=%s option=%s optlen=%d\n", opts, option,optlen);
}
}
+ lc->options = lcopts;
/* If option terminated by comma, eat it */
if (lc->ch == ',') {
}
}
-/*
- *
- * Store FileSet Include/Exclude info
+/*
+ *
+ * Store FileSet Include/Exclude info
* NEW style includes are handled in store_newinc()
*/
void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
* new Include is followed immediately by open brace, whereas the
* old include has options following the Include.
*/
- token = lex_get_token(lc, T_SKIP_EOL);
+ token = lex_get_token(lc, T_SKIP_EOL);
if (token == T_BOB) {
store_newinc(lc, item, index, pass);
return;
}
+ scan_err0(lc, _("Old style Include/Exclude not supported\n"));
/* What follows is scanning for the OLD style Include/Exclude */
/* Get include options */
inc_opts[0] = 0;
while ((token=lex_get_token(lc, T_SKIP_EOL)) != T_BOB) {
-
+
keyword = INC_KW_NONE;
for (i=0; FS_option_kw[i].name; i++) {
if (strcasecmp(lc->str, FS_option_kw[i].name) == 0) {
}
if (!inc_opts[0]) {
- strcat(inc_opts, "0"); /* set no options */
+ bstrncat(inc_opts, "0", sizeof(inc_opts)); /* set no options */
}
inc_opts_len = strlen(inc_opts);
break;
default:
scan_err1(lc, "Expected a filename, got: %s", lc->str);
- }
+ }
}
/* Note, MD5Final is done in backup.c */
} else { /* pass 2 */
- while (lex_get_token(lc, T_ALL) != T_EOB)
+ while (lex_get_token(lc, T_ALL) != T_EOB)
{}
}
scan_to_eol(lc);
/*
- * Store NEW style FileSet FInclude/FExclude info
+ * Store NEW style FileSet FInclude/FExclude info
*
* Note, when this routine is called, we are inside a FileSet
* resource. We treat the Include/Execlude like a sort of
{
int token, i;
INCEXE *incexe;
- bool options;
+ bool options;
if (!res_all.res_fs.have_MD5) {
MD5Init(&res_all.res_fs.md5c);
int token, rc;
regex_t preg;
char prbuf[500];
+ char *type;
+ int newsize;
- token = lex_get_token(lc, T_SKIP_EOL);
+ token = lex_get_token(lc, T_SKIP_EOL);
if (pass == 1) {
/* Pickup regex string
*/
break;
}
regfree(&preg);
- res_incexe.current_opts->regex.append(bstrdup(lc->str));
- Dmsg3(900, "set regex %p size=%d %s\n",
- res_incexe.current_opts, res_incexe.current_opts->regex.size(),lc->str);
+ if (item->code == 1) {
+ type = "regexdir";
+ res_incexe.current_opts->regexdir.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->regexdir.size();
+ } else if (item->code == 2) {
+ type = "regexfile";
+ res_incexe.current_opts->regexfile.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->regexfile.size();
+ } else {
+ type = "regex";
+ res_incexe.current_opts->regex.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->regex.size();
+ }
+ Dmsg4(900, "set %s %p size=%d %s\n",
+ type, res_incexe.current_opts, newsize, lc->str);
break;
default:
scan_err1(lc, _("Expected a regex string, got: %s\n"), lc->str);
- }
+ }
}
scan_to_eol(lc);
}
{
int token;
- token = lex_get_token(lc, T_NAME);
+ token = lex_get_token(lc, T_NAME);
if (pass == 1) {
/*
* Pickup Base Job Name
{
int token;
- token = lex_get_token(lc, T_NAME);
+ token = lex_get_token(lc, T_NAME);
if (pass == 1) {
/*
* Pickup reader command
*/
- res_incexe.current_opts->reader = bstrdup(lc->str);
+ res_incexe.current_opts->reader = bstrdup(lc->str);
}
scan_to_eol(lc);
}
{
int token;
- token = lex_get_token(lc, T_NAME);
+ token = lex_get_token(lc, T_NAME);
if (pass == 1) {
/*
* Pickup writer command
static void store_wild(LEX *lc, RES_ITEM *item, int index, int pass)
{
int token;
+ char *type;
+ int newsize;
- token = lex_get_token(lc, T_SKIP_EOL);
+ token = lex_get_token(lc, T_SKIP_EOL);
if (pass == 1) {
/*
* Pickup Wild-card string
case T_IDENTIFIER:
case T_UNQUOTED_STRING:
case T_QUOTED_STRING:
- res_incexe.current_opts->wild.append(bstrdup(lc->str));
- Dmsg3(900, "set wild %p size=%d %s\n",
- res_incexe.current_opts, res_incexe.current_opts->wild.size(),lc->str);
+ if (item->code == 1) {
+ type = "wilddir";
+ res_incexe.current_opts->wilddir.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->wilddir.size();
+ } else if (item->code == 2) {
+ type = "wildfile";
+ res_incexe.current_opts->wildfile.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->wildfile.size();
+ } else {
+ type = "wild";
+ res_incexe.current_opts->wild.append(bstrdup(lc->str));
+ newsize = res_incexe.current_opts->wild.size();
+ }
+ Dmsg4(9, "set %s %p size=%d %s\n",
+ type, res_incexe.current_opts, newsize, lc->str);
break;
default:
scan_err1(lc, _("Expected a wild-card string, got: %s\n"), lc->str);
- }
+ }
}
scan_to_eol(lc);
}
+/* Store fstype info */
+static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass)
+{
+ int token;
+
+ token = lex_get_token(lc, T_SKIP_EOL);
+ if (pass == 1) {
+ /* Pickup fstype string */
+ switch (token) {
+ case T_IDENTIFIER:
+ case T_UNQUOTED_STRING:
+ case T_QUOTED_STRING:
+ res_incexe.current_opts->fstype.append(bstrdup(lc->str));
+ Dmsg3(900, "set fstype %p size=%d %s\n",
+ res_incexe.current_opts, res_incexe.current_opts->fstype.size(), lc->str);
+ break;
+ default:
+ scan_err1(lc, _("Expected an fstype string, got: %s\n"), lc->str);
+ }
+ }
+ scan_to_eol(lc);
+}
/*
* Store Filename info. Note, for minor efficiency reasons, we
int token;
INCEXE *incexe;
- token = lex_get_token(lc, T_SKIP_EOL);
+ token = lex_get_token(lc, T_SKIP_EOL);
if (pass == 1) {
/* Pickup Filename string
*/
break;
default:
scan_err1(lc, _("Expected a filename, got: %s"), lc->str);
- }
+ }
}
scan_to_eol(lc);
}
+
/*
* Come here when Options seen in Include/Exclude
*/
{
int token, i;
- token = lex_get_token(lc, T_SKIP_EOL);
+ token = lex_get_token(lc, T_SKIP_EOL);
if (token != T_BOB) {
scan_err1(lc, "Expecting open brace. Got %s", lc->str);
}
if (pass == 1) {
setup_current_opts();
}
-
+
while ((token = lex_get_token(lc, T_ALL)) != T_EOF) {
if (token == T_EOL) {
continue;
FOPTS *fo = (FOPTS *)malloc(sizeof(FOPTS));
memset(fo, 0, sizeof(FOPTS));
fo->regex.init(1, true);
+ fo->regexdir.init(1, true);
+ fo->regexfile.init(1, true);
fo->wild.init(1, true);
+ fo->wilddir.init(1, true);
+ fo->wildfile.init(1, true);
fo->base.init(1, true);
+ fo->fstype.init(1, true);
res_incexe.current_opts = fo;
if (res_incexe.num_opts == 0) {
res_incexe.opts_list = (FOPTS **)malloc(sizeof(FOPTS *));
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
void term_job_server()
{
- jobq_destroy(&job_queue); /* ignore any errors */
+ jobq_destroy(&job_queue); /* ignore any errors */
}
/*
* Run a job -- typically called by the scheduler, but may also
- * be called by the UA (Console program).
+ * be called by the UA (Console program).
*
* Returns: 0 on failure
- * JobId on success
+ * JobId on success
*
*/
JobId_t run_job(JCR *jcr)
*/
Dmsg0(50, "Open database\n");
jcr->db=db_init_database(jcr, jcr->catalog->db_name, jcr->catalog->db_user,
- jcr->catalog->db_password, jcr->catalog->db_address,
- jcr->catalog->db_port, jcr->catalog->db_socket,
- jcr->catalog->mult_db_connections);
+ jcr->catalog->db_password, jcr->catalog->db_address,
+ jcr->catalog->db_port, jcr->catalog->db_socket,
+ jcr->catalog->mult_db_connections);
if (!jcr->db || !db_open_database(jcr, jcr->db)) {
Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\".\n"),
- jcr->catalog->db_name);
+ jcr->catalog->db_name);
if (jcr->db) {
Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
}
/*
- * This is the engine called by jobq.c:jobq_add() when we were pulled
+ * This is the engine called by jobq.c:jobq_add() when we were pulled
* from the work queue.
* At this point, we are running in our own thread and all
* necessary resources are allocated -- see jobq.c
for ( ;; ) {
Dmsg0(200, "=====Start Job=========\n");
- jcr->start_time = time(NULL); /* set the real start time */
+ jcr->start_time = time(NULL); /* set the real start time */
jcr->jr.StartTime = jcr->start_time;
set_jcr_job_status(jcr, JS_Running);
if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
}
if (job_canceled(jcr)) {
- update_job_end_record(jcr);
+ update_job_end_record(jcr);
} else if (jcr->job->MaxStartDelay != 0 && jcr->job->MaxStartDelay <
- (utime_t)(jcr->start_time - jcr->sched_time)) {
+ (utime_t)(jcr->start_time - jcr->sched_time)) {
Jmsg(jcr, M_FATAL, 0, _("Job canceled because max start delay time exceeded.\n"));
- set_jcr_job_status(jcr, JS_Canceled);
- update_job_end_record(jcr);
+ set_jcr_job_status(jcr, JS_Canceled);
+ update_job_end_record(jcr);
} else {
- /* Run Job */
- if (jcr->job->RunBeforeJob) {
- POOLMEM *before = get_pool_memory(PM_FNAME);
- int status;
- BPIPE *bpipe;
- char line[MAXSTRING];
-
+ /* Run Job */
+ if (jcr->job->RunBeforeJob) {
+ POOLMEM *before = get_pool_memory(PM_FNAME);
+ int status;
+ BPIPE *bpipe;
+ char line[MAXSTRING];
+
before = edit_job_codes(jcr, before, jcr->job->RunBeforeJob, "");
bpipe = open_bpipe(before, 0, "r");
- free_pool_memory(before);
- while (fgets(line, sizeof(line), bpipe->rfd)) {
+ free_pool_memory(before);
+ while (fgets(line, sizeof(line), bpipe->rfd)) {
Jmsg(jcr, M_INFO, 0, _("RunBefore: %s"), line);
- }
- status = close_bpipe(bpipe);
- if (status != 0) {
- berrno be;
+ }
+ status = close_bpipe(bpipe);
+ if (status != 0) {
+ berrno be;
Jmsg(jcr, M_FATAL, 0, _("RunBeforeJob error: ERR=%s\n"), be.strerror(status));
- set_jcr_job_status(jcr, JS_FatalError);
- update_job_end_record(jcr);
- goto bail_out;
- }
- }
- switch (jcr->JobType) {
- case JT_BACKUP:
- do_backup(jcr);
- if (jcr->JobStatus == JS_Terminated) {
- do_autoprune(jcr);
- }
- break;
- case JT_VERIFY:
- do_verify(jcr);
- if (jcr->JobStatus == JS_Terminated) {
- do_autoprune(jcr);
- }
- break;
- case JT_RESTORE:
- do_restore(jcr);
- if (jcr->JobStatus == JS_Terminated) {
- do_autoprune(jcr);
- }
- break;
- case JT_ADMIN:
- do_admin(jcr);
- if (jcr->JobStatus == JS_Terminated) {
- do_autoprune(jcr);
- }
- break;
- case JT_MIGRATION:
- case JT_COPY:
- case JT_ARCHIVE:
- do_mac(jcr); /* migration, archive, copy */
- if (jcr->JobStatus == JS_Terminated) {
- do_autoprune(jcr);
- }
- break;
- default:
+ set_jcr_job_status(jcr, JS_FatalError);
+ update_job_end_record(jcr);
+ goto bail_out;
+ }
+ }
+ switch (jcr->JobType) {
+ case JT_BACKUP:
+ do_backup(jcr);
+ if (jcr->JobStatus == JS_Terminated) {
+ do_autoprune(jcr);
+ }
+ break;
+ case JT_VERIFY:
+ do_verify(jcr);
+ if (jcr->JobStatus == JS_Terminated) {
+ do_autoprune(jcr);
+ }
+ break;
+ case JT_RESTORE:
+ do_restore(jcr);
+ if (jcr->JobStatus == JS_Terminated) {
+ do_autoprune(jcr);
+ }
+ break;
+ case JT_ADMIN:
+ do_admin(jcr);
+ if (jcr->JobStatus == JS_Terminated) {
+ do_autoprune(jcr);
+ }
+ break;
+ case JT_MIGRATION:
+ case JT_COPY:
+ case JT_ARCHIVE:
+ do_mac(jcr); /* migration, archive, copy */
+ if (jcr->JobStatus == JS_Terminated) {
+ do_autoprune(jcr);
+ }
+ break;
+ default:
Pmsg1(0, "Unimplemented job type: %d\n", jcr->JobType);
- break;
- }
- if ((jcr->job->RunAfterJob && jcr->JobStatus == JS_Terminated) ||
- (jcr->job->RunAfterFailedJob && jcr->JobStatus != JS_Terminated)) {
- POOLMEM *after = get_pool_memory(PM_FNAME);
- int status;
- BPIPE *bpipe;
- char line[MAXSTRING];
-
- if (jcr->JobStatus == JS_Terminated) {
+ break;
+ }
+ if ((jcr->job->RunAfterJob && jcr->JobStatus == JS_Terminated) ||
+ (jcr->job->RunAfterFailedJob && jcr->JobStatus != JS_Terminated)) {
+ POOLMEM *after = get_pool_memory(PM_FNAME);
+ int status;
+ BPIPE *bpipe;
+ char line[MAXSTRING];
+
+ if (jcr->JobStatus == JS_Terminated) {
after = edit_job_codes(jcr, after, jcr->job->RunAfterJob, "");
- } else {
+ } else {
after = edit_job_codes(jcr, after, jcr->job->RunAfterFailedJob, "");
- }
+ }
bpipe = open_bpipe(after, 0, "r");
- free_pool_memory(after);
- while (fgets(line, sizeof(line), bpipe->rfd)) {
+ free_pool_memory(after);
+ while (fgets(line, sizeof(line), bpipe->rfd)) {
Jmsg(jcr, M_INFO, 0, _("RunAfter: %s"), line);
- }
- status = close_bpipe(bpipe);
- /*
- * Note, if we get an error here, do not mark the
- * job in error, simply report the error condition.
- */
- if (status != 0) {
- berrno be;
- if (jcr->JobStatus == JS_Terminated) {
+ }
+ status = close_bpipe(bpipe);
+ /*
+ * Note, if we get an error here, do not mark the
+ * job in error, simply report the error condition.
+ */
+ if (status != 0) {
+ berrno be;
+ if (jcr->JobStatus == JS_Terminated) {
Jmsg(jcr, M_WARNING, 0, _("RunAfterJob error: ERR=%s\n"), be.strerror(status));
- } else {
+ } else {
Jmsg(jcr, M_FATAL, 0, _("RunAfterFailedJob error: ERR=%s\n"), be.strerror(status));
- }
- }
- }
- /* Send off any queued messages */
- if (jcr->msg_queue->size() > 0) {
- dequeue_messages(jcr);
- }
+ }
+ }
+ }
+ /* Send off any queued messages */
+ if (jcr->msg_queue->size() > 0) {
+ dequeue_messages(jcr);
+ }
}
bail_out:
break;
/*
* Cancel a job -- typically called by the UA (Console program), but may also
- * be called by the job watchdog.
+ * be called by the job watchdog.
*
* Returns: 1 if cancel appears to be successful
- * 0 on failure. Message sent to ua->jcr.
+ * 0 on failure. Message sent to ua->jcr.
*/
int cancel_job(UAContext *ua, JCR *jcr)
{
case JS_WaitStartTime:
set_jcr_job_status(jcr, JS_Canceled);
bsendmsg(ua, _("JobId %d, Job %s marked to be canceled.\n"),
- jcr->JobId, jcr->Job);
+ jcr->JobId, jcr->Job);
jobq_remove(&job_queue, jcr); /* attempt to remove it from queue */
return 1;
-
+
default:
set_jcr_job_status(jcr, JS_Canceled);
/* Cancel File daemon */
if (jcr->file_bsock) {
- ua->jcr->client = jcr->client;
- if (!connect_to_file_daemon(ua->jcr, 10, FDConnectTimeout, 1)) {
+ ua->jcr->client = jcr->client;
+ if (!connect_to_file_daemon(ua->jcr, 10, FDConnectTimeout, 1)) {
bsendmsg(ua, _("Failed to connect to File daemon.\n"));
- return 0;
- }
+ return 0;
+ }
Dmsg0(200, "Connected to file daemon\n");
- fd = ua->jcr->file_bsock;
+ fd = ua->jcr->file_bsock;
bnet_fsend(fd, "cancel Job=%s\n", jcr->Job);
- while (bnet_recv(fd) >= 0) {
+ while (bnet_recv(fd) >= 0) {
bsendmsg(ua, "%s", fd->msg);
- }
- bnet_sig(fd, BNET_TERMINATE);
- bnet_close(fd);
- ua->jcr->file_bsock = NULL;
+ }
+ bnet_sig(fd, BNET_TERMINATE);
+ bnet_close(fd);
+ ua->jcr->file_bsock = NULL;
}
/* Cancel Storage daemon */
if (jcr->store_bsock) {
- if (!ua->jcr->storage[0]) {
- copy_storage(ua->jcr, jcr);
- } else {
- ua->jcr->store = jcr->store;
- }
- if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) {
+ if (!ua->jcr->storage[0]) {
+ copy_storage(ua->jcr, jcr);
+ } else {
+ set_storage(ua->jcr, jcr->store);
+ }
+ if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) {
bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
- return 0;
- }
+ return 0;
+ }
Dmsg0(200, "Connected to storage daemon\n");
- sd = ua->jcr->store_bsock;
+ sd = ua->jcr->store_bsock;
bnet_fsend(sd, "cancel Job=%s\n", jcr->Job);
- while (bnet_recv(sd) >= 0) {
+ while (bnet_recv(sd) >= 0) {
bsendmsg(ua, "%s", sd->msg);
- }
- bnet_sig(sd, BNET_TERMINATE);
- bnet_close(sd);
- ua->jcr->store_bsock = NULL;
+ }
+ bnet_sig(sd, BNET_TERMINATE);
+ bnet_close(sd);
+ ua->jcr->store_bsock = NULL;
}
}
if (jcr->JobId == 0) {
Dmsg2(400, "Skipping JCR %p (%s) with JobId 0\n",
- jcr, jcr->Job);
- /* Keep reference counts correct */
- free_locked_jcr(jcr);
- continue;
+ jcr, jcr->Job);
+ /* Keep reference counts correct */
+ free_locked_jcr(jcr);
+ continue;
}
/* check MaxWaitTime */
if (cancel) {
Dmsg3(200, "Cancelling JCR %p jobid %d (%s)\n",
- jcr, jcr->JobId, jcr->Job);
+ jcr, jcr->JobId, jcr->Job);
- UAContext *ua = new_ua_context(jcr);
- ua->jcr = control_jcr;
- cancel_job(ua, jcr);
- free_ua_context(ua);
+ UAContext *ua = new_ua_context(jcr);
+ ua->jcr = control_jcr;
+ cancel_job(ua, jcr);
+ free_ua_context(ua);
Dmsg1(200, "Have cancelled JCR %p\n", jcr);
}
}
if ((watchdog_time - jcr->start_time) < jcr->job->MaxWaitTime) {
Dmsg3(200, "Job %p (%s) with MaxWaitTime %d not expired\n",
- jcr, jcr->Job, jcr->job->MaxWaitTime);
+ jcr, jcr->Job, jcr->job->MaxWaitTime);
return false;
}
Dmsg3(200, "Job %d (%s): MaxWaitTime of %d seconds exceeded, "
"checking status\n",
- jcr->JobId, jcr->Job, jcr->job->MaxWaitTime);
+ jcr->JobId, jcr->Job, jcr->job->MaxWaitTime);
switch (jcr->JobStatus) {
case JS_Created:
case JS_Blocked:
case JS_WaitMount:
case JS_WaitMedia:
case JS_WaitFD:
- cancel = true;
+ cancel = true;
Dmsg0(200, "JCR blocked in #2\n");
- break;
+ break;
default:
Dmsg0(200, "JCR not blocked in #2\n");
- break;
+ break;
}
break;
case JS_Terminated:
break;
default:
Jmsg1(jcr, M_ERROR, 0, _("Unhandled job status code %d\n"),
- jcr->JobStatus);
+ jcr->JobStatus);
}
Dmsg3(200, "MaxWaitTime result: %scancel JCR %p (%s)\n",
cancel ? "" : "do not ", jcr, jcr->job);
}
if ((watchdog_time - jcr->start_time) < jcr->job->MaxRunTime) {
Dmsg3(200, "Job %p (%s) with MaxRunTime %d not expired\n",
- jcr, jcr->Job, jcr->job->MaxRunTime);
+ jcr, jcr->Job, jcr->job->MaxRunTime);
return false;
}
break;
default:
Jmsg1(jcr, M_ERROR, 0, _("Unhandled job status code %d\n"),
- jcr->JobStatus);
+ jcr->JobStatus);
}
Dmsg3(200, "MaxRunTime result: %scancel JCR %p (%s)\n",
pm_strcpy(jcr->client_name, jcr->client->hdr.name);
if (!db_create_client_record(jcr, jcr->db, &cr)) {
Jmsg(jcr, M_FATAL, 0, _("Could not create Client record. ERR=%s\n"),
- db_strerror(jcr->db));
+ db_strerror(jcr->db));
return false;
}
jcr->jr.ClientId = cr.ClientId;
if (cr.Uname[0]) {
if (!jcr->client_uname) {
- jcr->client_uname = get_pool_memory(PM_NAME);
+ jcr->client_uname = get_pool_memory(PM_NAME);
}
pm_strcpy(jcr->client_uname, cr.Uname);
}
!db_get_fileset_record(jcr, jcr->db, fsr)) {
if (!db_create_fileset_record(jcr, jcr->db, fsr)) {
Jmsg(jcr, M_ERROR, 0, _("Could not create FileSet \"%s\" record. ERR=%s\n"),
- fsr->FileSet, db_strerror(jcr->db));
- return false;
+ fsr->FileSet, db_strerror(jcr->db));
+ return false;
}
}
jcr->jr.FileSetId = fsr->FileSetId;
if (fsr->created) {
Jmsg(jcr, M_INFO, 0, _("Created new FileSet record \"%s\" %s\n"),
- fsr->FileSet, fsr->cCreateTime);
+ fsr->FileSet, fsr->cCreateTime);
}
Dmsg2(119, "Created FileSet %s record %u\n", jcr->fileset->hdr.name,
jcr->jr.FileSetId);
{
jcr->jr.SchedTime = jcr->sched_time;
jcr->jr.StartTime = jcr->start_time;
- jcr->jr.EndTime = 0; /* perhaps rescheduled, clear it */
+ jcr->jr.EndTime = 0; /* perhaps rescheduled, clear it */
jcr->jr.JobType = jcr->JobType;
jcr->jr.JobLevel = jcr->JobLevel;
jcr->jr.JobStatus = jcr->JobStatus;
jcr->jr.VolSessionTime = jcr->VolSessionTime;
if (!db_update_job_end_record(jcr, jcr->db, &jcr->jr)) {
Jmsg(jcr, M_WARNING, 0, _("Error updating job record. %s"),
- db_strerror(jcr->db));
+ db_strerror(jcr->db));
}
}
/* Guarantee unique start time -- maximum one per second, and
* thus unique Job Name
*/
- P(mutex); /* lock creation of jobs */
+ P(mutex); /* lock creation of jobs */
now = time(NULL);
while (now == last_start_time) {
bmicrosleep(0, 500000);
now = time(NULL);
}
last_start_time = now;
- V(mutex); /* allow creation of jobs */
+ V(mutex); /* allow creation of jobs */
jcr->start_time = now;
/* Form Unique JobName */
localtime_r(&now, &tm);
/* Use only characters that are permitted in Windows filenames */
strftime(dt, sizeof(dt), "%Y-%m-%d_%H.%M.%S", &tm);
bstrncpy(name, base_name, sizeof(name));
- name[sizeof(name)-22] = 0; /* truncate if too long */
+ name[sizeof(name)-22] = 0; /* truncate if too long */
bsnprintf(jcr->Job, sizeof(jcr->Job), "%s.%s", name, dt); /* add date & time */
/* Convert spaces into underscores */
for (p=jcr->Job; *p; p++) {
}
}
-/*
- * Free the Job Control Record if no one is still using it.
- * Called from main free_jcr() routine in src/lib/jcr.c so
- * that we can do our Director specific cleanup of the jcr.
- */
-void dird_free_jcr(JCR *jcr)
+/* Called directly from job rescheduling */
+void dird_free_jcr_pointers(JCR *jcr)
{
- Dmsg0(200, "Start dird free_jcr\n");
-
if (jcr->sd_auth_key) {
free(jcr->sd_auth_key);
jcr->sd_auth_key = NULL;
}
if (jcr->term_wait_inited) {
pthread_cond_destroy(&jcr->term_wait);
+ jcr->term_wait_inited = false;
+ }
+}
+
+/*
+ * Free the Job Control Record if no one is still using it.
+ * Called from main free_jcr() routine in src/lib/jcr.c so
+ * that we can do our Director specific cleanup of the jcr.
+ */
+void dird_free_jcr(JCR *jcr)
+{
+ Dmsg0(200, "Start dird free_jcr\n");
+
+ dird_free_jcr_pointers(jcr);
+
+ /* Delete lists setup to hold storage pointers */
+ for (int i=0; i<MAX_STORE; i++) {
+ if (jcr->storage[i]) {
+ delete jcr->storage[i];
+ jcr->storage[i] = NULL;
+ }
}
jcr->job_end_push.destroy();
Dmsg0(200, "End dird free_jcr\n");
break;
}
jcr->JobPriority = job->Priority;
+ /* Copy storage definitions -- deleted in dir_free_jcr above */
for (int i=0; i<MAX_STORE; i++) {
- jcr->storage[i] = job->storage[i];
+ STORE *st;
+ if (job->storage[i]) {
+ if (jcr->storage[i]) {
+ delete jcr->storage[i];
+ }
+ jcr->storage[i] = New(alist(10, not_owned_by_alist));
+ foreach_alist(st, job->storage[i]) {
+ jcr->storage[i]->append(st);
+ }
+ }
}
- if (!jcr->store && jcr->storage[0]) {
+ if (jcr->storage[0]) {
jcr->store = (STORE *)jcr->storage[0]->first();
}
jcr->client = job->client;
if (jcr->JobLevel == 0) {
switch (jcr->JobType) {
case JT_VERIFY:
- jcr->JobLevel = L_VERIFY_CATALOG;
- break;
+ jcr->JobLevel = L_VERIFY_CATALOG;
+ break;
case JT_BACKUP:
- jcr->JobLevel = L_INCREMENTAL;
- break;
+ jcr->JobLevel = L_INCREMENTAL;
+ break;
case JT_RESTORE:
case JT_ADMIN:
- jcr->JobLevel = L_NONE;
- break;
+ jcr->JobLevel = L_NONE;
+ break;
default:
- break;
+ break;
}
}
}
{
for (int i=0; i < MAX_STORE; i++) {
if (old_jcr->storage[i]) {
- STORE *st;
- new_jcr->storage[i] = New(alist(10, not_owned_by_alist));
- foreach_alist(st, old_jcr->storage[i]) {
- new_jcr->storage[i]->append(st);
- }
+ STORE *st;
+ new_jcr->storage[i] = New(alist(10, not_owned_by_alist));
+ foreach_alist(st, old_jcr->storage[i]) {
+ new_jcr->storage[i]->append(st);
+ }
+ if (old_jcr->storage[i]) {
+ delete old_jcr->storage[i];
+ }
}
if (old_jcr->store) {
- new_jcr->store = old_jcr->store;
+ new_jcr->store = old_jcr->store;
} else if (new_jcr->storage[0]) {
- new_jcr->store = (STORE *)new_jcr->storage[0]->first();
+ new_jcr->store = (STORE *)new_jcr->storage[0]->first();
}
}
}
+
+/* Set storage override */
+void set_storage(JCR *jcr, STORE *store)
+{
+ jcr->store = store;
+ jcr->storage[0]->prepend(store);
+}
*
*/
/*
- Copyright (C) 2003-2004 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "bacula.h"
#include "dird.h"
+extern JCR *jobs;
/* Forward referenced functions */
extern "C" void *jobq_server(void *arg);
static int start_server(jobq_t *jq);
-/*
+
+
+/*
* Initialize a job queue
*
* Returns: 0 on success
{
int stat;
jobq_item_t *item = NULL;
-
+
if ((stat = pthread_attr_init(&jq->attr)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_attr_init: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_attr_init: ERR=%s\n", be.strerror(stat));
return stat;
}
if ((stat = pthread_attr_setdetachstate(&jq->attr, PTHREAD_CREATE_DETACHED)) != 0) {
return stat;
}
if ((stat = pthread_mutex_init(&jq->mutex, NULL)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_init: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_init: ERR=%s\n", be.strerror(stat));
pthread_attr_destroy(&jq->attr);
return stat;
}
if ((stat = pthread_cond_init(&jq->work, NULL)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_init: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_cond_init: ERR=%s\n", be.strerror(stat));
pthread_mutex_destroy(&jq->mutex);
pthread_attr_destroy(&jq->attr);
return stat;
jq->num_workers = 0; /* no threads yet */
jq->idle_workers = 0; /* no idle threads */
jq->engine = engine; /* routine to run */
- jq->valid = JOBQ_VALID;
+ jq->valid = JOBQ_VALID;
/* Initialize the job queues */
jq->waiting_jobs = New(dlist(item, &item->link));
jq->running_jobs = New(dlist(item, &item->link));
{
int stat, stat1, stat2;
- if (jq->valid != JOBQ_VALID) {
- return EINVAL;
- }
- if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
- return stat;
- }
- jq->valid = 0; /* prevent any more operations */
-
- /*
- * If any threads are active, wake them
- */
- if (jq->num_workers > 0) {
- jq->quit = true;
- if (jq->idle_workers) {
- if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_broadcast: ERR=%s\n", strerror(stat));
- pthread_mutex_unlock(&jq->mutex);
- return stat;
- }
- }
- while (jq->num_workers > 0) {
- if ((stat = pthread_cond_wait(&jq->work, &jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_wait: ERR=%s\n", strerror(stat));
- pthread_mutex_unlock(&jq->mutex);
- return stat;
- }
- }
- }
- if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
- return stat;
- }
- stat = pthread_mutex_destroy(&jq->mutex);
- stat1 = pthread_cond_destroy(&jq->work);
- stat2 = pthread_attr_destroy(&jq->attr);
- delete jq->waiting_jobs;
- delete jq->running_jobs;
- delete jq->ready_jobs;
- return (stat != 0 ? stat : (stat1 != 0 ? stat1 : stat2));
+ if (jq->valid != JOBQ_VALID) {
+ return EINVAL;
+ }
+ if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+ return stat;
+ }
+ jq->valid = 0; /* prevent any more operations */
+
+ /*
+ * If any threads are active, wake them
+ */
+ if (jq->num_workers > 0) {
+ jq->quit = true;
+ if (jq->idle_workers) {
+ if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_cond_broadcast: ERR=%s\n", be.strerror(stat));
+ pthread_mutex_unlock(&jq->mutex);
+ return stat;
+ }
+ }
+ while (jq->num_workers > 0) {
+ if ((stat = pthread_cond_wait(&jq->work, &jq->mutex)) != 0) {
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_cond_wait: ERR=%s\n", be.strerror(stat));
+ pthread_mutex_unlock(&jq->mutex);
+ return stat;
+ }
+ }
+ }
+ if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
+ return stat;
+ }
+ stat = pthread_mutex_destroy(&jq->mutex);
+ stat1 = pthread_cond_destroy(&jq->work);
+ stat2 = pthread_attr_destroy(&jq->attr);
+ delete jq->waiting_jobs;
+ delete jq->running_jobs;
+ delete jq->ready_jobs;
+ return (stat != 0 ? stat : (stat1 != 0 ? stat1 : stat2));
}
struct wait_pkt {
* most jobs are put into the job queue only when their
* scheduled time arives.
*/
-extern "C"
+extern "C"
void *sched_wait(void *arg)
{
JCR *jcr = ((wait_pkt *)arg)->jcr;
jobq_t *jq = ((wait_pkt *)arg)->jq;
- Dmsg0(300, "Enter sched_wait.\n");
+ Dmsg0(2300, "Enter sched_wait.\n");
free(arg);
time_t wtime = jcr->sched_time - time(NULL);
set_jcr_job_status(jcr, JS_WaitStartTime);
/* Wait until scheduled time arrives */
if (wtime > 0) {
- Jmsg(jcr, M_INFO, 0, _("Job %s waiting %d seconds for scheduled start time.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Job %s waiting %d seconds for scheduled start time.\n"),
jcr->Job, wtime);
}
- /* Check every 30 seconds if canceled */
+ /* Check every 30 seconds if canceled */
while (wtime > 0) {
- Dmsg2(300, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, wtime);
+ Dmsg2(2300, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, wtime);
if (wtime > 30) {
wtime = 30;
}
jobq_add(jq, jcr);
V(jcr->mutex);
free_jcr(jcr); /* we are done with jcr */
- Dmsg0(300, "Exit sched_wait\n");
+ Dmsg0(2300, "Exit sched_wait\n");
return NULL;
}
/*
* Add a job to the queue
* jq is a queue that was created with jobq_init
- *
+ *
* On entry jcr->mutex must be locked.
- *
+ *
*/
int jobq_add(jobq_t *jq, JCR *jcr)
{
time_t wtime = jcr->sched_time - time(NULL);
pthread_t id;
wait_pkt *sched_pkt;
-
- Dmsg3(300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
+
+ Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
if (jq->valid != JOBQ_VALID) {
Jmsg0(jcr, M_ERROR, 0, "Jobq_add queue not initialized.\n");
return EINVAL;
}
jcr->use_count++; /* mark jcr in use by us */
- Dmsg3(300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
+ Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count);
if (!job_canceled(jcr) && wtime > 0) {
set_thread_concurrency(jq->max_workers + 2);
sched_pkt = (wait_pkt *)malloc(sizeof(wait_pkt));
sched_pkt->jcr = jcr;
sched_pkt->jq = jq;
- jcr->use_count--; /* release our use of jcr */
+// jcr->use_count--; /* release our use of jcr */
stat = pthread_create(&id, &jq->attr, sched_wait, (void *)sched_pkt);
if (stat != 0) { /* thread not created */
- Jmsg1(jcr, M_ERROR, 0, "pthread_thread_create: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(jcr, M_ERROR, 0, "pthread_thread_create: ERR=%s\n", be.strerror(stat));
}
return stat;
}
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(jcr, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(jcr, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
jcr->use_count--; /* release jcr */
return stat;
}
if (job_canceled(jcr)) {
/* Add job to ready queue so that it is canceled quickly */
jq->ready_jobs->prepend(item);
- Dmsg1(300, "Prepended job=%d to ready queue\n", jcr->JobId);
+ Dmsg1(2300, "Prepended job=%d to ready queue\n", jcr->JobId);
} else {
/* Add this job to the wait queue in priority sorted order */
foreach_dlist(li, jq->waiting_jobs) {
- Dmsg2(300, "waiting item jobid=%d priority=%d\n",
+ Dmsg2(2300, "waiting item jobid=%d priority=%d\n",
li->jcr->JobId, li->jcr->JobPriority);
if (li->jcr->JobPriority > jcr->JobPriority) {
jq->waiting_jobs->insert_before(item, li);
- Dmsg2(300, "insert_before jobid=%d before waiting job=%d\n",
+ Dmsg2(2300, "insert_before jobid=%d before waiting job=%d\n",
li->jcr->JobId, jcr->JobId);
inserted = true;
break;
/* If not jobs in wait queue, append it */
if (!inserted) {
jq->waiting_jobs->append(item);
- Dmsg1(300, "Appended item jobid=%d to waiting queue\n", jcr->JobId);
+ Dmsg1(2300, "Appended item jobid=%d to waiting queue\n", jcr->JobId);
}
}
stat = start_server(jq);
pthread_mutex_unlock(&jq->mutex);
- Dmsg0(300, "Return jobq_add\n");
+ Dmsg0(2300, "Return jobq_add\n");
return stat;
}
int stat;
bool found = false;
jobq_item_t *item;
-
- Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
+
+ Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
if (jq->valid != JOBQ_VALID) {
return EINVAL;
}
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
return stat;
}
}
if (!found) {
pthread_mutex_unlock(&jq->mutex);
- Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
+ Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
return EINVAL;
}
/* Move item to be the first on the list */
jq->waiting_jobs->remove(item);
jq->ready_jobs->prepend(item);
- Dmsg2(300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);
-
+ Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);
+
stat = start_server(jq);
pthread_mutex_unlock(&jq->mutex);
- Dmsg0(300, "Return jobq_remove\n");
+ Dmsg0(2300, "Return jobq_remove\n");
return stat;
}
/* if any threads are idle, wake one */
if (jq->idle_workers > 0) {
- Dmsg0(300, "Signal worker to wake up\n");
+ Dmsg0(2300, "Signal worker to wake up\n");
if ((stat = pthread_cond_signal(&jq->work)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_signal: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_cond_signal: ERR=%s\n", be.strerror(stat));
return stat;
}
} else if (jq->num_workers < jq->max_workers) {
- Dmsg0(300, "Create worker thread\n");
+ Dmsg0(2300, "Create worker thread\n");
/* No idle threads so create a new one */
set_thread_concurrency(jq->max_workers + 1);
if ((stat = pthread_create(&id, &jq->attr, jobq_server, (void *)jq)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_create: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_create: ERR=%s\n", be.strerror(stat));
return stat;
}
}
}
-/*
+/*
* This is the worker thread that serves the job queue.
- * When all the resources are acquired for the job,
+ * When all the resources are acquired for the job,
* it will call the user's engine.
*/
-extern "C"
+extern "C"
void *jobq_server(void *arg)
{
struct timespec timeout;
bool timedout = false;
bool work = true;
- Dmsg0(300, "Start jobq_server\n");
+ Dmsg0(2300, "Start jobq_server\n");
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
return NULL;
}
jq->num_workers++;
struct timeval tv;
struct timezone tz;
- Dmsg0(300, "Top of for loop\n");
+ Dmsg0(2300, "Top of for loop\n");
if (!work && !jq->quit) {
gettimeofday(&tv, &tz);
timeout.tv_nsec = 0;
/*
* Wait 4 seconds, then if no more work, exit
*/
- Dmsg0(300, "pthread_cond_timedwait()\n");
+ Dmsg0(2300, "pthread_cond_timedwait()\n");
stat = pthread_cond_timedwait(&jq->work, &jq->mutex, &timeout);
if (stat == ETIMEDOUT) {
- Dmsg0(300, "timedwait timedout.\n");
+ Dmsg0(2300, "timedwait timedout.\n");
timedout = true;
break;
} else if (stat != 0) {
/* This shouldn't happen */
- Dmsg0(300, "This shouldn't happen\n");
+ Dmsg0(2300, "This shouldn't happen\n");
jq->num_workers--;
pthread_mutex_unlock(&jq->mutex);
return NULL;
}
break;
- }
+ }
}
- /*
+ /*
* If anything is in the ready queue, run it
*/
- Dmsg0(300, "Checking ready queue.\n");
+ Dmsg0(2300, "Checking ready queue.\n");
while (!jq->ready_jobs->empty() && !jq->quit) {
JCR *jcr;
- je = (jobq_item_t *)jq->ready_jobs->first();
+ je = (jobq_item_t *)jq->ready_jobs->first();
jcr = je->jcr;
jq->ready_jobs->remove(je);
if (!jq->ready_jobs->empty()) {
- Dmsg0(300, "ready queue not empty start server\n");
+ Dmsg0(2300, "ready queue not empty start server\n");
if (start_server(jq) != 0) {
jq->num_workers--;
pthread_mutex_unlock(&jq->mutex);
}
}
jq->running_jobs->append(je);
- Dmsg1(300, "Took jobid=%d from ready and appended to run\n", jcr->JobId);
+ Dmsg1(2300, "Took jobid=%d from ready and appended to run\n", jcr->JobId);
/* Release job queue lock */
- if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
- jq->num_workers--;
- return NULL;
- }
+ V(jq->mutex);
/* Call user's routine here */
- Dmsg1(300, "Calling user engine for jobid=%d\n", jcr->JobId);
+ Dmsg1(2300, "Calling user engine for jobid=%d\n", jcr->JobId);
jq->engine(je->jcr);
- Dmsg1(300, "Back from user engine jobid=%d.\n", jcr->JobId);
+ Dmsg1(2300, "Back from user engine jobid=%d.\n", jcr->JobId);
/* Reacquire job queue lock */
- if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
- jq->num_workers--;
- free(je); /* release job entry */
- return NULL;
- }
+ P(jq->mutex);
Dmsg0(200, "Done lock mutex after running job. Release locks.\n");
jq->running_jobs->remove(je);
- /*
+ /*
* Release locks if acquired. Note, they will not have
* been acquired for jobs canceled before they were
* put into the ready queue.
*/
if (jcr->acquired_resource_locks) {
jcr->store->NumConcurrentJobs--;
- if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
- jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;
- }
jcr->client->NumConcurrentJobs--;
jcr->job->NumConcurrentJobs--;
}
/*
* Reschedule the job if necessary and requested
*/
- if (jcr->job->RescheduleOnError &&
+ if (jcr->job->RescheduleOnError &&
jcr->JobStatus != JS_Terminated &&
- jcr->JobStatus != JS_Canceled &&
- jcr->job->RescheduleTimes > 0 &&
+ jcr->JobStatus != JS_Canceled &&
+ jcr->job->RescheduleTimes > 0 &&
jcr->reschedule_count < jcr->job->RescheduleTimes) {
char dt[50];
*/
jcr->reschedule_count++;
jcr->sched_time = time(NULL) + jcr->job->RescheduleInterval;
- Dmsg2(300, "Rescheduled Job %s to re-run in %d seconds.\n", jcr->Job,
+ Dmsg2(2300, "Rescheduled Job %s to re-run in %d seconds.\n", jcr->Job,
(int)jcr->job->RescheduleInterval);
bstrftime(dt, sizeof(dt), time(NULL));
Jmsg(jcr, M_INFO, 0, _("Rescheduled Job %s at %s to re-run in %d seconds.\n"),
jcr->Job, dt, (int)jcr->job->RescheduleInterval);
- dird_free_jcr(jcr); /* partial cleanup old stuff */
+ dird_free_jcr_pointers(jcr); /* partial cleanup old stuff */
jcr->JobStatus = JS_WaitStartTime;
jcr->SDJobStatus = 0;
if (jcr->JobBytes == 0) {
- Dmsg1(300, "Requeue job=%d\n", jcr->JobId);
+ Dmsg1(2300, "Requeue job=%d\n", jcr->JobId);
jcr->JobStatus = JS_WaitStartTime;
V(jq->mutex);
jobq_add(jq, jcr); /* queue the job to run again */
free(je); /* free the job entry */
continue; /* look for another job to run */
}
- /*
+ /*
* Something was actually backed up, so we cannot reuse
* the old JobId or there will be database record
* conflicts. We now create a new job, copying the
njcr->JobStatus = jcr->JobStatus;
copy_storage(njcr, jcr);
njcr->messages = jcr->messages;
- Dmsg0(300, "Call to run new job\n");
+ Dmsg0(2300, "Call to run new job\n");
V(jq->mutex);
run_job(njcr); /* This creates a "new" job */
free_jcr(njcr); /* release "new" jcr */
P(jq->mutex);
- Dmsg0(300, "Back from running new job.\n");
+ Dmsg0(2300, "Back from running new job.\n");
}
/* Clean up and release old jcr */
if (jcr->db) {
db_close_database(jcr, jcr->db);
jcr->db = NULL;
}
- Dmsg2(300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count);
+ Dmsg2(2300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count);
jcr->SDJobStatus = 0;
V(jq->mutex); /* release internal lock */
free_jcr(jcr);
* If any job in the wait queue can be run,
* move it to the ready queue
*/
- Dmsg0(300, "Done check ready, now check wait queue.\n");
+ Dmsg0(2300, "Done check ready, now check wait queue.\n");
while (!jq->waiting_jobs->empty() && !jq->quit) {
int Priority;
- je = (jobq_item_t *)jq->waiting_jobs->first();
+ je = (jobq_item_t *)jq->waiting_jobs->first();
jobq_item_t *re = (jobq_item_t *)jq->running_jobs->first();
if (re) {
Priority = re->jcr->JobPriority;
- Dmsg2(300, "JobId %d is running. Look for pri=%d\n", re->jcr->JobId, Priority);
+ Dmsg2(2300, "JobId %d is running. Look for pri=%d\n", re->jcr->JobId, Priority);
} else {
Priority = je->jcr->JobPriority;
- Dmsg1(300, "No job running. Look for Job pri=%d\n", Priority);
+ Dmsg1(2300, "No job running. Look for Job pri=%d\n", Priority);
}
/*
* Walk down the list of waiting jobs and attempt
for ( ; je; ) {
/* je is current job item on the queue, jn is the next one */
JCR *jcr = je->jcr;
+ bool skip_this_jcr = false;
jobq_item_t *jn = (jobq_item_t *)jq->waiting_jobs->next(je);
- Dmsg3(300, "Examining Job=%d JobPri=%d want Pri=%d\n",
+ Dmsg3(2300, "Examining Job=%d JobPri=%d want Pri=%d\n",
jcr->JobId, jcr->JobPriority, Priority);
/* Take only jobs of correct Priority */
if (jcr->JobPriority != Priority) {
if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
/* Let only one Restore/verify job run at a time regardless of MaxConcurrentJobs */
if (jcr->store->NumConcurrentJobs == 0) {
- jcr->store->NumConcurrentJobs++;
- jcr->saveMaxConcurrentJobs = jcr->store->MaxConcurrentJobs;
- jcr->store->MaxConcurrentJobs = 1;
+ jcr->store->NumConcurrentJobs = 1;
} else {
set_jcr_job_status(jcr, JS_WaitStoreRes);
- je = jn;
+ je = jn; /* point to next waiting job */
continue;
}
+ /* We are not doing a Restore or Verify */
+ } else if (jcr->store->NumConcurrentJobs == 0 &&
+ jcr->store->NumConcurrentJobs < jcr->store->MaxConcurrentJobs) {
+ /* Simple case, first job */
+ jcr->store->NumConcurrentJobs = 1;
} else if (jcr->store->NumConcurrentJobs < jcr->store->MaxConcurrentJobs) {
- jcr->store->NumConcurrentJobs++;
+ /*
+ * At this point, we already have at least one Job running
+ * for this Storage daemon, so we must ensure that there
+ * is no Volume conflict. In general, it should be OK, if
+ * all Jobs pull from the same Pool, so we check the Pools.
+ */
+ JCR *njcr;
+ lock_jcr_chain();
+ for (njcr=jobs; njcr; njcr=njcr->next) {
+ if (njcr->JobId == 0 || njcr == jcr) {
+ continue;
+ }
+ if (njcr->store == jcr->store && njcr->pool != jcr->pool) {
+ skip_this_jcr = true;
+ break;
+ }
+ }
+ unlock_jcr_chain();
+ if (!skip_this_jcr) {
+ jcr->store->NumConcurrentJobs++;
+ }
} else {
+ skip_this_jcr = true;
+ }
+ if (skip_this_jcr) {
set_jcr_job_status(jcr, JS_WaitStoreRes);
- je = jn;
+ je = jn; /* point to next waiting job */
continue;
}
} else {
/* Back out previous locks */
jcr->store->NumConcurrentJobs--;
- if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
- jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;
- }
set_jcr_job_status(jcr, JS_WaitClientRes);
- je = jn;
+ je = jn; /* point to next waiting job */
continue;
}
if (jcr->job->NumConcurrentJobs < jcr->job->MaxConcurrentJobs) {
} else {
/* Back out previous locks */
jcr->store->NumConcurrentJobs--;
- if (jcr->JobType == JT_RESTORE || jcr->JobType == JT_VERIFY) {
- jcr->store->MaxConcurrentJobs = jcr->saveMaxConcurrentJobs;
- }
jcr->client->NumConcurrentJobs--;
set_jcr_job_status(jcr, JS_WaitJobRes);
- je = jn;
+ je = jn; /* Point to next waiting job */
continue;
}
/* Got all locks, now remove it from wait queue and append it
- * to the ready queue
+ * to the ready queue
*/
jcr->acquired_resource_locks = true;
jq->waiting_jobs->remove(je);
jq->ready_jobs->append(je);
- Dmsg1(300, "moved JobId=%d from wait to ready queue\n", je->jcr->JobId);
- je = jn;
+ Dmsg1(2300, "moved JobId=%d from wait to ready queue\n", je->jcr->JobId);
+ je = jn; /* Point to next waiting job */
} /* end for loop */
break;
} /* end while loop */
- Dmsg0(300, "Done checking wait queue.\n");
+ Dmsg0(2300, "Done checking wait queue.\n");
/*
* If no more ready work and we are asked to quit, then do it
*/
if (jq->ready_jobs->empty() && jq->quit) {
jq->num_workers--;
if (jq->num_workers == 0) {
- Dmsg0(300, "Wake up destroy routine\n");
+ Dmsg0(2300, "Wake up destroy routine\n");
/* Wake up destroy routine if he is waiting */
pthread_cond_broadcast(&jq->work);
}
break;
}
- Dmsg0(300, "Check for work request\n");
- /*
+ Dmsg0(2300, "Check for work request\n");
+ /*
* If no more work requests, and we waited long enough, quit
*/
- Dmsg2(300, "timedout=%d read empty=%d\n", timedout,
+ Dmsg2(2300, "timedout=%d read empty=%d\n", timedout,
jq->ready_jobs->empty());
if (jq->ready_jobs->empty() && timedout) {
- Dmsg0(300, "break big loop\n");
+ Dmsg0(2300, "break big loop\n");
jq->num_workers--;
break;
}
work = !jq->ready_jobs->empty() || !jq->waiting_jobs->empty();
if (work) {
- /*
+ /*
* If a job is waiting on a Resource, don't consume all
* the CPU time looping looking for work, and even more
* important, release the lock so that a job that has
* terminated can give us the resource.
*/
if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
jq->num_workers--;
return NULL;
}
bmicrosleep(2, 0); /* pause for 2 seconds */
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
jq->num_workers--;
return NULL;
}
/* Recompute work as something may have changed in last 2 secs */
work = !jq->ready_jobs->empty() || !jq->waiting_jobs->empty();
}
- Dmsg1(300, "Loop again. work=%d\n", work);
+ Dmsg1(2300, "Loop again. work=%d\n", work);
} /* end of big for loop */
Dmsg0(200, "unlock mutex\n");
if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", strerror(stat));
+ berrno be;
+ Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
}
- Dmsg0(300, "End jobq_server\n");
+ Dmsg0(2300, "End jobq_server\n");
return NULL;
}
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
int max_retry_time, int verbose)
{
BSOCK *sd;
- STORE *store = jcr->store;
- if (!store) {
- jcr->store = store = (STORE *)jcr->storage[0]->first();
+ STORE *store;
+
+ if (!jcr->storage[0]) {
+ Jmsg(jcr, M_FATAL, 0, _("Attempt to contact the Storage daemon with no Storage resource.\n"));
+ return false;
}
+ store = (STORE *)jcr->storage[0]->first();
/*
* Open message channel with the Storage daemon
*/
int start_storage_daemon_job(JCR *jcr)
{
- int status;
+ int status = 0;
STORE *storage;
BSOCK *sd;
char auth_key[100];
POOL_MEM device_name, pool_name, pool_type, media_type;
+ int i;
- storage = jcr->store;
sd = jcr->store_bsock;
/*
* Now send JobId and permissions, and get back the authorization key.
/*
* Send use device = xxx media = yyy pool = zzz
*/
- pm_strcpy(device_name, storage->dev_name);
- pm_strcpy(media_type, storage->media_type);
- pm_strcpy(pool_type, jcr->pool->pool_type);
- pm_strcpy(pool_name, jcr->pool->hdr.name);
- bash_spaces(device_name);
- bash_spaces(media_type);
- bash_spaces(pool_type);
- bash_spaces(pool_name);
- bnet_fsend(sd, use_device, device_name.c_str(),
- media_type.c_str(), pool_name.c_str(), pool_type.c_str());
- Dmsg1(110, ">stored: %s", sd->msg);
- status = response(jcr, sd, OK_device, "Use Device", NO_DISPLAY);
- if (!status) {
- pm_strcpy(pool_type, sd->msg); /* save message */
- Jmsg(jcr, M_FATAL, 0, _("\n"
- " Storage daemon didn't accept Device \"%s\" because:\n %s"),
- device_name.c_str(), pool_type.c_str()/* sd->msg */);
+
+ for (i=0; i < MAX_STORE; i++) {
+ if (jcr->storage[i]) {
+ storage = (STORE *)jcr->storage[i]->first();
+ pm_strcpy(device_name, storage->dev_name);
+ pm_strcpy(media_type, storage->media_type);
+ pm_strcpy(pool_type, jcr->pool->pool_type);
+ pm_strcpy(pool_name, jcr->pool->hdr.name);
+ bash_spaces(device_name);
+ bash_spaces(media_type);
+ bash_spaces(pool_type);
+ bash_spaces(pool_name);
+ bnet_fsend(sd, use_device, device_name.c_str(),
+ media_type.c_str(), pool_name.c_str(), pool_type.c_str());
+ Dmsg1(110, ">stored: %s", sd->msg);
+ status = response(jcr, sd, OK_device, "Use Device", NO_DISPLAY);
+ if (!status) {
+ pm_strcpy(pool_type, sd->msg); /* save message */
+ Jmsg(jcr, M_FATAL, 0, _("\n"
+ " Storage daemon didn't accept Device \"%s\" because:\n %s"),
+ device_name.c_str(), pool_type.c_str()/* sd->msg */);
+ }
+ }
}
return status;
}
/* fd_cmds.c */
extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
- int max_retry_time, int verbose);
+ int max_retry_time, int verbose);
extern int send_include_list(JCR *jcr);
extern int send_exclude_list(JCR *jcr);
extern int send_bootstrap_file(JCR *jcr);
extern int get_attributes_and_put_in_catalog(JCR *jcr);
extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
extern int put_file_into_catalog(JCR *jcr, long file_index, char *fname,
- char *link, char *attr, int stream);
+ char *link, char *attr, int stream);
extern void get_level_since_time(JCR *jcr, char *since, int since_len);
extern int send_run_before_and_after_commands(JCR *jcr);
extern int cancel_job(UAContext *ua, JCR *jcr);
extern void init_jcr_job_record(JCR *jcr);
extern void copy_storage(JCR *new_jcr, JCR *old_jcr);
+extern void set_storage(JCR *jcr, STORE *store);
/* mountreq.c */
extern void mount_request(JCR *jcr, BSOCK *bs, char *buf);
/* msgchan.c */
extern bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
- int max_retry_time, int verbose);
+ int max_retry_time, int verbose);
extern int start_storage_daemon_job(JCR *jcr);
extern int start_storage_daemon_message_thread(JCR *jcr);
extern int bget_dirmsg(BSOCK *bs);
void free_ua_context(UAContext *ua);
/* ua_select.c */
-STORE *select_storage_resource(UAContext *ua);
-JOB *select_job_resource(UAContext *ua);
-JOB *select_restore_job_resource(UAContext *ua);
-CLIENT *select_client_resource(UAContext *ua);
+STORE *select_storage_resource(UAContext *ua);
+JOB *select_job_resource(UAContext *ua);
+JOB *select_restore_job_resource(UAContext *ua);
+CLIENT *select_client_resource(UAContext *ua);
FILESET *select_fileset_resource(UAContext *ua);
-int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
-int select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
-bool select_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
-
-void start_prompt(UAContext *ua, const char *msg);
-void add_prompt(UAContext *ua, const char *prompt);
-int do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
-CAT *get_catalog_resource(UAContext *ua);
+int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
+int select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
+bool select_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+
+void start_prompt(UAContext *ua, const char *msg);
+void add_prompt(UAContext *ua, const char *prompt);
+int do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
+CAT *get_catalog_resource(UAContext *ua);
STORE *get_storage_resource(UAContext *ua, int use_default);
-int get_media_type(UAContext *ua, char *MediaType, int max_media);
-bool get_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+int get_media_type(UAContext *ua, char *MediaType, int max_media);
+bool get_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
POOL *get_pool_resource(UAContext *ua);
POOL *select_pool_resource(UAContext *ua);
CLIENT *get_client_resource(UAContext *ua);
-int get_job_dbr(UAContext *ua, JOB_DBR *jr);
+int get_job_dbr(UAContext *ua, JOB_DBR *jr);
int find_arg_keyword(UAContext *ua, const char **list);
int find_arg(UAContext *ua, const char *keyword);
/* ua_purge.c */
int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr);
+
+/* ua_run.c */
+extern int run_cmd(UAContext *ua, const char *cmd);
SELECT max(JobId) AS Jobs,sum(JobFiles) AS Files,sum(JobBytes) As Bytes
FROM Job;
# 2
-:List where a File is saved regardless of the directory:
+:List up to 20 places where a File is saved regardless of the directory:
*Enter Filename (no path):
SELECT DISTINCT Job.JobId as JobId, Client.Name as Client,
Path.Path,Filename.Name,StartTime,Level,JobFiles,JobBytes
int recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
{
struct s_oldest_ctx oldest;
+ char ed1[50];
POOLMEM *query = get_pool_memory(PM_EMSG);
const char *select =
"SELECT MediaId,LastWritten FROM Media "
- "WHERE PoolId=%u AND Recycle=1 AND VolStatus='Purged' "
+ "WHERE PoolId=%s AND Recycle=1 AND VolStatus='Purged' "
"AND MediaType='%s' %s"
"ORDER BY LastWritten ASC,MediaId LIMIT 1";
Dmsg0(100, "Enter recycle_oldest_purged_volume\n");
oldest.MediaId = 0;
if (InChanger) {
- Mmsg(query, select, mr->PoolId, mr->MediaType, "AND InChanger=1 ");
+ Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType,
+ "AND InChanger=1 ");
} else {
- Mmsg(query, select, mr->PoolId, mr->MediaType, "");
+ Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType, "");
}
if (!db_sql_query(jcr->db, query, oldest_handler, (void *)&oldest)) {
Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
}
Dmsg0(100, "return 0 recycle_oldest_purged_volume end\n");
- return 0;
+ return 0;
}
/*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
jcr->dif_pool = run->dif_pool; /* override dif pool */
}
if (run->storage) {
- jcr->store = run->storage; /* override storage */
+ set_storage(jcr, run->storage); /* override storage */
}
if (run->msgs) {
jcr->messages = run->msgs; /* override messages */
const char *select_restore_del =
"SELECT DISTINCT DelCandidates.JobId "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND delCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%u "
"AND Job.Type='R')";
const char *select_admin_del =
"SELECT DISTINCT DelCandidates.JobId "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND delCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%u "
"AND Job.Type='D')";
bool automount; /* if set, mount after label */
bool quit; /* if set, quit */
bool verbose; /* set for normal UA verbosity */
+ bool batch; /* set for non-interactive mode */
uint32_t pint32_val; /* positive integer */
int32_t int32_val; /* positive/negative */
};
*
* Bacula Director -- User Agent Access Control List (ACL) handling
*
- * Kern Sibbald, January MMIV
+ * Kern Sibbald, January MMIV
*
* Version $Id$
*/
/*
- Copyright (C) 2004 Kern Sibbald and John Walker
+ Copyright (C) 2004-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "bacula.h"
#include "dird.h"
-/*
- * Check if access is permitted to item in acl
+/*
+ * Check if access is permitted to item in acl
*/
bool acl_access_ok(UAContext *ua, int acl, char *item)
{
}
+/* This version expects the length of the item which we must check. */
bool acl_access_ok(UAContext *ua, int acl, char *item, int len)
{
/* If no console resource => default console and all is permitted */
if (!ua->cons) {
- Dmsg0(400, "Root cons access OK.\n");
+ Dmsg0(1400, "Root cons access OK.\n");
return true; /* No cons resource -> root console OK for everything */
}
/* Search list for item */
for (int i=0; i<list->size(); i++) {
- if (strncasecmp(item, (char *)list->get(i), len) == 0) {
- Dmsg3(400, "Found %s in %d %s\n", item, acl, (char *)list->get(i));
+ if (strcasecmp(item, (char *)list->get(i)) == 0) {
+ Dmsg3(1400, "ACL found %s in %d %s\n", item, acl, (char *)list->get(i));
return true;
}
}
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
extern int gui_cmd(UAContext *ua, const char *cmd);
extern int sqlquerycmd(UAContext *ua, const char *cmd);
extern int querycmd(UAContext *ua, const char *cmd);
-extern int run_cmd(UAContext *ua, const char *cmd);
extern int retentioncmd(UAContext *ua, const char *cmd);
extern int prunecmd(UAContext *ua, const char *cmd);
extern int purgecmd(UAContext *ua, const char *cmd);
struct cmdstruct { const char *key; int (*func)(UAContext *ua, const char *cmd); const char *help; };
static struct cmdstruct commands[] = {
{ N_("add"), add_cmd, _("add media to a pool")},
- { N_("autodisplay"), autodisplay_cmd, _("autodisplay [on/off] -- console messages")},
- { N_("automount"), automount_cmd, _("automount [on/off] -- after label")},
- { N_("cancel"), cancel_cmd, _("cancel job=nnn -- cancel a job")},
+ { N_("autodisplay"), autodisplay_cmd, _("autodisplay [on|off] -- console messages")},
+ { N_("automount"), automount_cmd, _("automount [on|off] -- after label")},
+ { N_("cancel"), cancel_cmd, _("cancel <job=nnn> -- cancel a job")},
{ N_("create"), create_cmd, _("create DB Pool from resource")},
{ N_("delete"), delete_cmd, _("delete [pool=<pool-name> | media volume=<volume-name>]")},
{ N_("estimate"), estimate_cmd, _("performs FileSet estimate, listing gives full listing")},
{ N_("exit"), quit_cmd, _("exit = quit")},
- { N_("gui"), gui_cmd, _("gui [on/off] -- non-interactive gui mode")},
+ { N_("gui"), gui_cmd, _("gui [on|off] -- non-interactive gui mode")},
{ N_("help"), help_cmd, _("print this command")},
- { N_("list"), list_cmd, _("list [pools | jobs | jobtotals | media <pool> | files jobid=<nn>]; from catalog")},
+ { N_("list"), list_cmd, _("list [pools | jobs | jobtotals | media <pool=pool-name> | files <jobid=nn>]; from catalog")},
{ N_("label"), label_cmd, _("label a tape")},
{ N_("llist"), llist_cmd, _("full or long list like list command")},
{ N_("messages"), messagescmd, _("messages")},
BSOCK *sd;
JCR *jcr = ua->jcr;
- jcr->store = store;
+ set_storage(jcr, store);
/* Try connecting for up to 15 seconds */
bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d\n"),
store->hdr.name, store->address, store->SDport);
/* Count Storage items */
LockRes();
store = NULL;
- for (i=0; (store = (STORE *)GetNextRes(R_STORAGE, (RES *)store)); i++)
- { }
+ i = 0;
+ foreach_res(store, R_STORAGE) {
+ i++;
+ }
unique_store = (STORE **) malloc(i * sizeof(STORE));
/* Find Unique Storage address/port */
store = (STORE *)GetNextRes(R_STORAGE, NULL);
/* Count Client items */
LockRes();
client = NULL;
- for (i=0; (client = (CLIENT *)GetNextRes(R_CLIENT, (RES *)client)); i++)
- { }
+ i = 0;
+ foreach_res(client, R_CLIENT) {
+ i++;
+ }
unique_client = (CLIENT **) malloc(i * sizeof(CLIENT));
/* Find Unique Client address/port */
client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
Dmsg2(120, "Found storage, MediaType=%s DevName=%s\n",
store->media_type, store->dev_name);
- jcr->store = store;
+ set_storage(jcr, store);
if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
bsendmsg(ua, _("Failed to connect to Storage daemon.\n"));
return;
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
if (!store) {
return 1;
}
- ua->jcr->store = store;
+ set_storage(ua->jcr, store);
scan = find_arg(ua, _("scan")) >= 0;
if (!store) {
return 1;
}
- ua->jcr->store = store;
+ set_storage(ua->jcr, store);
if (!relabel && find_arg_keyword(ua, barcode_keyword) >= 0) {
label_from_barcodes(ua);
extern DIRRES *director;
-static POOLMEM *substitute_prompts(UAContext *ua,
+static POOLMEM *substitute_prompts(UAContext *ua,
POOLMEM *query, char **prompt, int nprompt);
/*
char *prompt[9];
int nprompt = 0;;
char *query_file = director->query_file;
-
+
if (!open_db(ua)) {
goto bail_out;
}
prompt[nprompt++] = bstrdup(line+1);
continue;
}
- }
+ }
if (*query != 0) {
pm_strcat(query, " ");
}
return 1;
}
-static POOLMEM *substitute_prompts(UAContext *ua,
+static POOLMEM *substitute_prompts(UAContext *ua,
POOLMEM *query, char **prompt, int nprompt)
{
char *p, *q, *o;
}
*query = 0;
- bsendmsg(ua, _("Entering SQL query mode.\n\
-Terminate each query with a semicolon.\n\
-Terminate query mode with a blank line.\n"));
+ bsendmsg(ua, _("Entering SQL query mode.\n"
+"Terminate each query with a semicolon.\n"
+"Terminate query mode with a blank line.\n"));
msg = "Enter SQL query: ";
while (get_cmd(ua, msg)) {
len = strlen(ua->cmd);
}
query = check_pool_memory_size(query, len + 1);
if (*query != 0) {
- strcat(query, " ");
+ pm_strcat(query, " ");
}
- strcat(query, ua->cmd);
+ pm_strcat(query, ua->cmd);
if (ua->cmd[len-1] == ';') {
ua->cmd[len-1] = 0; /* zap ; */
/* Submit query */
}
free_pool_memory(query);
bsendmsg(ua, _("End query mode.\n"));
- return 1;
+ return 1;
}
*/
/*
- Copyright (C) 2002-2004 Kern Sibbald and John Walker
+ Copyright (C) 2002-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* Imported functions */
-extern int run_cmd(UAContext *ua, const char *cmd);
extern void print_bsr(UAContext *ua, RBSR *bsr);
/* Imported variables */
goto bail_out;
}
- /*
+ /*
* Request user to select JobIds or files by various different methods
* last 20 jobs, where File saved, most recent backup, ...
* In the end, a list of files are pumped into
/* Build run command */
if (rx.where) {
- Mmsg(ua->cmd,
+ Mmsg(ua->cmd,
"run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\""
" where=\"%s\" files=%d catalog=\"%s\"",
job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"",
working_directory, rx.where, rx.selected_files, ua->catalog->hdr.name);
} else {
- Mmsg(ua->cmd,
+ Mmsg(ua->cmd,
"run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\""
" files=%d catalog=\"%s\"",
job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"",
}
-static void free_rx(RESTORE_CTX *rx)
+static void free_rx(RESTORE_CTX *rx)
{
free_bsr(rx->bsr);
rx->bsr = NULL;
}
/*
- * The first step in the restore process is for the user to
+ * The first step in the restore process is for the user to
* select a list of JobIds from which he will subsequently
* select which files are to be restored.
*/
JOB_DBR jr;
bool done = false;
int i, j;
- const char *list[] = {
+ const char *list[] = {
"List last 20 Jobs run",
"List Jobs where a given File is saved",
"Enter list of comma separated JobIds to select",
- "Enter SQL list command",
+ "Enter SQL list command",
"Select the most recent backup for a client",
"Select backup for a client before a specified time",
"Enter a list of files to restore",
case 6: /* all specified */
rx->all = true;
break;
- /*
+ /*
* All keywords 7 or greater are ignored or handled by a select prompt
*/
default:
if (rx->name_list.num_ids) {
return 2; /* filename list made */
}
-
+
if (!done) {
bsendmsg(ua, _("\nFirst you select one or more JobIds that contain files\n"
"to be restored. You will be presented several methods\n"
if (!get_client_name(ua, rx)) {
return 0;
}
- bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
+ bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
"containg a list of file names with paths, and terminate\n"
"them with a blank line.\n"));
for ( ;; ) {
if (!get_client_name(ua, rx)) {
return 0;
}
- bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
+ bsendmsg(ua, _("Enter file names with paths, or < to enter a filename\n"
"containg a list of file names with paths, and terminate\n"
"them with a blank line.\n"));
for ( ;; ) {
}
return 2;
-
+
case 8: /* Cancel or quit */
return 0;
}
bsendmsg(ua, _("No Jobs selected.\n"));
return 0;
}
- bsendmsg(ua, _("You have selected the following JobId%s: %s\n"),
+ bsendmsg(ua, _("You have selected the following JobId%s: %s\n"),
strchr(rx->JobIds,',')?"s":"",rx->JobIds);
memset(&jr, 0, sizeof(JOB_DBR));
}
jr.JobId = JobId;
if (!db_get_job_record(ua->jcr, ua->db, &jr)) {
- bsendmsg(ua, _("Unable to get Job record for JobId=%u: ERR=%s\n"),
+ bsendmsg(ua, _("Unable to get Job record for JobId=%u: ERR=%s\n"),
JobId, db_strerror(ua->db));
return 0;
}
if (!acl_access_ok(ua, Job_ACL, jr.Name)) {
- bsendmsg(ua, _("No authorization. Job \"%s\" not selected.\n"),
+ bsendmsg(ua, _("No authorization. Job \"%s\" not selected.\n"),
jr.Name);
- continue;
+ continue;
}
rx->TotalFiles += jr.JobFiles;
}
return 1;
}
-/*
+/*
* Get date from user
*/
static int get_date(UAContext *ua, char *date, int date_len)
break;
}
bsendmsg(ua, _("Improper date format.\n"));
- }
+ }
bstrncpy(date, ua->cmd, date_len);
return 1;
}
/*
- * Insert a single file, or read a list of files from a file
+ * Insert a single file, or read a list of files from a file
*/
static void insert_one_file(UAContext *ua, RESTORE_CTX *rx, char *date)
{
char file[5000];
char *p = ua->cmd;
int line = 0;
-
+
switch (*p) {
case '<':
p++;
if ((ffd = fopen(p, "r")) == NULL) {
+ berrno be;
bsendmsg(ua, _("Cannot open file %s: ERR=%s\n"),
- p, strerror(errno));
+ p, be.strerror());
break;
}
while (fgets(file, sizeof(file), ffd)) {
* lookup the most recent backup in the catalog to get the JobId
* and FileIndex, then insert them into the findex list.
*/
-static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
+static int insert_file_into_findex_list(UAContext *ua, RESTORE_CTX *rx, char *file,
char *date)
{
strip_trailing_junk(file);
if (*rx->JobIds == 0) {
Mmsg(rx->query, uar_jobid_fileindex, date, rx->path, rx->fname, rx->ClientName);
} else {
- Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date,
+ Mmsg(rx->query, uar_jobids_fileindex, rx->JobIds, date,
rx->path, rx->fname, rx->ClientName);
}
rx->found = false;
/* Find and insert jobid and File Index */
if (!db_sql_query(ua->db, rx->query, jobid_fileindex_handler, (void *)rx)) {
- bsendmsg(ua, _("Query failed: %s. ERR=%s\n"),
+ bsendmsg(ua, _("Query failed: %s. ERR=%s\n"),
rx->query, db_strerror(ua->db));
}
if (!rx->found) {
{
char *p, *f;
- /* Find path without the filename.
+ /* Find path without the filename.
* I.e. everything after the last / is a "filename".
* OK, maybe it is a directory name, but we treat it like
* a filename. If we don't find a / then the whole name
}
/* If filename doesn't exist (i.e. root directory), we
- * simply create a blank name consisting of a single
+ * simply create a blank name consisting of a single
* space. This makes handling zero length filenames
* easier.
*/
rx->fnl = 0;
}
- rx->pnl = f - name;
+ rx->pnl = f - name;
if (rx->pnl > 0) {
rx->path = check_pool_memory_size(rx->path, rx->pnl+1);
memcpy(rx->path, name, rx->pnl);
bool OK = true;
memset(&tree, 0, sizeof(TREE_CTX));
- /*
+ /*
* Build the directory tree containing JobIds user selected
*/
tree.root = new_tree(rx->TotalFiles);
}
for (p=rx->JobIds; get_next_jobid_from_list(&p, &JobId) > 0; ) {
- if (JobId == last_JobId) {
+ if (JobId == last_JobId) {
continue; /* eliminate duplicate JobIds */
}
last_JobId = JobId;
}
}
char ec1[50];
- bsendmsg(ua, "\n%d Job%s, %s files inserted into the tree%s.\n",
+ bsendmsg(ua, "\n%d Job%s, %s files inserted into the tree%s.\n",
items, items==1?"":"s", edit_uint64_with_commas(tree.FileCount, ec1),
tree.all?" and marked for extraction":"");
}
/*
- * Walk down through the tree finding all files marked to be
+ * Walk down through the tree finding all files marked to be
* extracted making a bootstrap file.
*/
if (OK) {
bstrncpy(rx->ClientName, cr.Name, sizeof(rx->ClientName));
/*
- * Get FileSet
+ * Get FileSet
*/
memset(&fsr, 0, sizeof(fsr));
- i = find_arg_with_value(ua, "FileSet");
+ i = find_arg_with_value(ua, "FileSet");
if (i >= 0) {
bstrncpy(fsr.FileSet, ua->argv[i], sizeof(fsr.FileSet));
if (!db_get_fileset_record(ua->jcr, ua->db, &fsr)) {
- bsendmsg(ua, _("Error getting FileSet \"%s\": ERR=%s\n"), fsr.FileSet,
+ bsendmsg(ua, _("Error getting FileSet \"%s\": ERR=%s\n"), fsr.FileSet,
db_strerror(ua->db));
i = -1;
}
if (!db_sql_query(ua->db, rx->query, fileset_handler, (void *)ua)) {
bsendmsg(ua, "%s\n", db_strerror(ua->db));
}
- if (do_prompt(ua, _("FileSet"), _("Select FileSet resource"),
+ if (do_prompt(ua, _("FileSet"), _("Select FileSet resource"),
fileset_name, sizeof(fileset_name)) < 0) {
goto bail_out;
}
/* Display a list of Jobs selected for this restore */
db_list_sql_query(ua->jcr, ua->db, uar_list_temp, prtit, ua, 1, HORZ_LIST);
} else {
- bsendmsg(ua, _("No jobs found.\n"));
+ bsendmsg(ua, _("No jobs found.\n"));
}
stat = 1;
-
+
bail_out:
db_sql_query(ua->db, uar_del_temp, NULL, NULL);
db_sql_query(ua->db, uar_del_temp1, NULL, NULL);
return 0;
}
*p = q;
- *JobId = strtoul(jobid, NULL, 10);
+ *JobId = str_to_int64(jobid);
return 1;
}
static int count_handler(void *ctx, int num_fields, char **row)
{
RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
- rx->JobId = atoi(row[0]);
+ rx->JobId = str_to_int64(row[0]);
rx->found = true;
return 0;
}
static int jobid_fileindex_handler(void *ctx, int num_fields, char **row)
{
RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
- rx->JobId = atoi(row[0]);
- add_findex(rx->bsr, rx->JobId, atoi(row[1]));
+ rx->JobId = str_to_int64(row[0]);
+ add_findex(rx->bsr, rx->JobId, str_to_int64(row[1]));
rx->found = true;
return 0;
}
{
RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
- if (strcmp(rx->last_jobid, row[0]) == 0) {
+ if (strcmp(rx->last_jobid, row[0]) == 0) {
return 0; /* duplicate id */
}
bstrncpy(rx->last_jobid, row[0], sizeof(rx->last_jobid));
{
RESTORE_CTX *rx = (RESTORE_CTX *)ctx;
- rx->JobTDate = str_to_int64(row[1]);
+ rx->JobTDate = str_to_int64(row[1]);
return 0;
}
{
NAME_LIST *name = (NAME_LIST *)ctx;
- if (name->num_ids == MAX_ID_LIST_LEN) {
+ if (name->num_ids == MAX_ID_LIST_LEN) {
return 1;
}
if (name->num_ids == name->max_ids) {
* Print names in the list
*/
static void print_name_list(UAContext *ua, NAME_LIST *name_list)
-{
+{
for (int i=0; i < name_list->num_ids; i++) {
bsendmsg(ua, "%s\n", name_list->name[i]);
}
* Free names in the list
*/
static void free_name_list(NAME_LIST *name_list)
-{
+{
for (int i=0; i < name_list->num_ids; i++) {
free(name_list->name[i]);
}
return;
}
/*
- * We have a single MediaType, look it up in our Storage resource
+ * We have a single MediaType, look it up in our Storage resource
*/
LockRes();
foreach_res(store, R_STORAGE) {
if (rx->store) {
/* Check if an explicit storage resource is given */
store = NULL;
- int i = find_arg_with_value(ua, "storage");
+ int i = find_arg_with_value(ua, "storage");
if (i > 0) {
store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
if (store && !acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
bsendmsg(ua, _("\nWarning. Unable to find Storage resource for\n"
"MediaType \"%s\", needed by the Jobs you selected.\n"
"You will be allowed to select a Storage device later.\n"),
- name_list->name[0]);
+ name_list->name[0]);
}
}
*/
/*
- Copyright (C) 2001-2004 Kern Sibbald and John Walker
+ Copyright (C) 2001-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
* For Restore Jobs
* run <job-name> jobid=nn
*
+ * Returns: 0 on error
+ * JobId if OK
+ *
+ * Returns: 0 on error
+ * JobId if OK
+ *
*/
int run_cmd(UAContext *ua, const char *cmd)
{
catalog_name = NULL;
for (i=1; i<ua->argc; i++) {
- Dmsg2(200, "Doing arg %d = %s\n", i, ua->argk[i]);
+ Dmsg2(800, "Doing arg %d = %s\n", i, ua->argk[i]);
kw_ok = false;
/* Keep looking until we find a good keyword */
for (j=0; !kw_ok && kw[j]; j++) {
bsendmsg(ua, _("Value missing for keyword %s\n"), ua->argk[i]);
return 1;
}
- Dmsg1(200, "Got keyword=%s\n", kw[j]);
+ Dmsg1(800, "Got keyword=%s\n", kw[j]);
switch (j) {
case 0: /* job */
if (job_name) {
bsendmsg(ua, _("Job name specified twice.\n"));
- return 1;
+ return 0;
}
job_name = ua->argv[i];
kw_ok = true;
case 1: /* JobId */
if (jid) {
bsendmsg(ua, _("JobId specified twice.\n"));
- return 1;
+ return 0;
}
jid = ua->argv[i];
kw_ok = true;
case 3: /* fd */
if (client_name) {
bsendmsg(ua, _("Client specified twice.\n"));
- return 1;
+ return 0;
}
client_name = ua->argv[i];
kw_ok = true;
case 4: /* fileset */
if (fileset_name) {
bsendmsg(ua, _("FileSet specified twice.\n"));
- return 1;
+ return 0;
}
fileset_name = ua->argv[i];
kw_ok = true;
case 5: /* level */
if (level_name) {
bsendmsg(ua, _("Level specified twice.\n"));
- return 1;
+ return 0;
}
level_name = ua->argv[i];
kw_ok = true;
case 7: /* sd */
if (store_name) {
bsendmsg(ua, _("Storage specified twice.\n"));
- return 1;
+ return 0;
}
store_name = ua->argv[i];
kw_ok = true;
case 8: /* pool */
if (pool_name) {
bsendmsg(ua, _("Pool specified twice.\n"));
- return 1;
+ return 0;
}
pool_name = ua->argv[i];
kw_ok = true;
case 9: /* where */
if (where) {
bsendmsg(ua, _("Where specified twice.\n"));
- return 1;
+ return 0;
}
where = ua->argv[i];
kw_ok = true;
case 10: /* bootstrap */
if (bootstrap) {
bsendmsg(ua, _("Bootstrap specified twice.\n"));
- return 1;
+ return 0;
}
bootstrap = ua->argv[i];
kw_ok = true;
case 11: /* replace */
if (replace) {
bsendmsg(ua, _("Replace specified twice.\n"));
- return 1;
+ return 0;
}
replace = ua->argv[i];
kw_ok = true;
case 12: /* When */
if (when) {
bsendmsg(ua, _("When specified twice.\n"));
- return 1;
+ return 0;
}
when = ua->argv[i];
kw_ok = true;
case 13: /* Priority */
if (Priority) {
bsendmsg(ua, _("Priority specified twice.\n"));
- return 1;
+ return 0;
}
Priority = atoi(ua->argv[i]);
if (Priority <= 0) {
case 15: /* Verify Job */
if (verify_job_name) {
bsendmsg(ua, _("Verify Job specified twice.\n"));
- return 1;
+ return 0;
}
verify_job_name = ua->argv[i];
kw_ok = true;
Dmsg1(200, "Set jobname=%s\n", job_name);
} else {
bsendmsg(ua, _("Invalid keyword: %s\n"), ua->argk[i]);
- return 1;
+ return 0;
}
}
} /* end argc loop */
- Dmsg0(200, "Done scan.\n");
+ Dmsg0(800, "Done scan.\n");
CAT *catalog = NULL;
if (catalog_name != NULL) {
catalog = (CAT *)GetResWithName(R_CATALOG, catalog_name);
if (catalog == NULL) {
bsendmsg(ua, _("Catalog \"%s\" not found\n"), catalog_name);
- return 1;
+ return 0;
}
}
+ Dmsg1(200, "Using catalog=%s\n", catalog_name);
if (job_name) {
/* Find Job */
job = select_job_resource(ua);
}
if (!job) {
- return 1;
+ return 0;
} else if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) {
bsendmsg(ua, _("No authorization. Job \"%s\".\n"),
job->hdr.name);
- return 1;
+ return 0;
}
if (store_name) {
} else if (!acl_access_ok(ua, Storage_ACL, store->hdr.name)) {
bsendmsg(ua, _("No authorization. Storage \"%s\".\n"),
store->hdr.name);
- return 1;
+ return 0;
}
+ Dmsg1(200, "Using storage=%s\n", store->hdr.name);
if (pool_name) {
pool = (POOL *)GetResWithName(R_POOL, pool_name);
pool = job->pool; /* use default */
}
if (!pool) {
- return 1;
- } else if (!acl_access_ok(ua, Pool_ACL, store->hdr.name)) {
+ return 0;
+ } else if (!acl_access_ok(ua, Pool_ACL, pool->hdr.name)) {
bsendmsg(ua, _("No authorization. Pool \"%s\".\n"),
pool->hdr.name);
- return 1;
+ return 0;
}
+ Dmsg1(200, "Using pool\n", pool->hdr.name);
if (client_name) {
client = (CLIENT *)GetResWithName(R_CLIENT, client_name);
client = job->client; /* use default */
}
if (!client) {
- return 1;
- } else if (!acl_access_ok(ua, Client_ACL, store->hdr.name)) {
+ return 0;
+ } else if (!acl_access_ok(ua, Client_ACL, client->hdr.name)) {
bsendmsg(ua, _("No authorization. Client \"%s\".\n"),
client->hdr.name);
- return 1;
+ return 0;
}
+ Dmsg1(200, "Using client=%s\n", client->hdr.name);
if (fileset_name) {
fileset = (FILESET *)GetResWithName(R_FILESET, fileset_name);
fileset = job->fileset; /* use default */
}
if (!fileset) {
- return 1;
- } else if (!acl_access_ok(ua, FileSet_ACL, store->hdr.name)) {
+ return 0;
+ } else if (!acl_access_ok(ua, FileSet_ACL, fileset->hdr.name)) {
bsendmsg(ua, _("No authorization. FileSet \"%s\".\n"),
fileset->hdr.name);
- return 1;
+ return 0;
}
if (verify_job_name) {
set_jcr_defaults(jcr, job);
jcr->verify_job = verify_job;
- jcr->store = store;
+ set_storage(jcr, store);
jcr->client = client;
jcr->fileset = fileset;
jcr->pool = pool;
}
/* Run without prompting? */
- if (find_arg(ua, _("yes")) > 0) {
+ if (ua->batch || find_arg(ua, _("yes")) > 0) {
goto start_job;
}
/* Storage */
store = select_storage_resource(ua);
if (store) {
- jcr->store = store;
+ set_storage(jcr, store);
goto try_again;
}
break;
} else {
bsendmsg(ua, _("Job started. JobId=%u\n"), JobId);
}
- return 1;
+ return JobId;
}
bail_out:
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "bacula.h"
#include "dird.h"
-/* Imported subroutines */
-
/* Imported variables */
extern int r_first;
extern int r_last;
extern int console_msg_pending;
extern char my_name[];
-/* Static variables */
-
-/* Exported variables */
-int quit_cmd_thread = 0;
-
-/* Imported functions */
/* Forward referenced functions */
-
extern "C" void *connect_thread(void *arg);
-
static void *handle_UA_client_request(void *arg);
if ((status=pthread_create(&thid, NULL, connect_thread, (void *)myaddrs)) != 0) {
berrno be;
- be.set_errno(status);
- Emsg1(M_ABORT, 0, _("Cannot create UA thread: %s\n"), be.strerror());
+ Emsg1(M_ABORT, 0, _("Cannot create UA thread: %s\n"), be.strerror(status));
}
started = TRUE;
return;
}
-extern "C"
+extern "C"
void *connect_thread(void *arg)
{
pthread_detach(pthread_self());
- /* ****FIXME**** put # 10 (timeout) on config parameter */
+ /* Permit 10 console connections */
bnet_thread_server((dlist*)arg, 10, &ua_workq, handle_UA_client_request);
return NULL;
}
{
JCR *jcr;
jcr = new_jcr(sizeof(JCR), dird_free_jcr);
+ /*
+ * The job and defaults are not really used, but
+ * we set them up to ensure that everything is correctly
+ * initialized.
+ */
+ LockRes();
+ jcr->job = (JOB *)GetNextRes(R_JOB, NULL);
+ set_jcr_defaults(jcr, jcr->job);
+ UnlockRes();
jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */
create_unique_job_name(jcr, base_name);
jcr->sched_time = jcr->start_time;
jcr->JobLevel = L_NONE;
jcr->JobStatus = JS_Running;
jcr->JobId = 0;
- /*
- * None of these are really defined for control JCRs, so we
- * simply take the first of each one. This ensures that there
- * will be no null pointer references.
- */
- LockRes();
- jcr->job = (JOB *)GetNextRes(R_JOB, NULL);
- jcr->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
- jcr->client = (CLIENT *)GetNextRes(R_CLIENT, NULL);
- jcr->pool = (POOL *)GetNextRes(R_POOL, NULL);
- jcr->catalog = (CAT *)GetNextRes(R_CATALOG, NULL);
- jcr->store = (STORE *)GetNextRes(R_STORAGE, NULL);
- jcr->fileset = (FILESET *)GetNextRes(R_FILESET, NULL);
- UnlockRes();
return jcr;
}
/*
- * Handle Director User Agent commands
+ * Handle Director User Agent commands
*
*/
static void *handle_UA_client_request(void *arg)
int stat;
UAContext *ua;
JCR *jcr;
- BSOCK *UA_sock = (BSOCK *)arg;
pthread_detach(pthread_self());
jcr = new_control_jcr("*Console*", JT_CONSOLE);
ua = new_ua_context(jcr);
- ua->UA_sock = UA_sock;
+ ua->UA_sock = (BSOCK *)arg;
bnet_recv(ua->UA_sock); /* Get first message */
if (!authenticate_user_agent(ua)) {
}
if (!ua->quit) {
if (ua->auto_display_messages) {
- strcpy(ua->cmd, "messages");
+ pm_strcpy(ua->cmd, "messages");
qmessagescmd(ua, ua->cmd);
ua->user_notified_msg_pending = FALSE;
} else if (!ua->user_notified_msg_pending && console_msg_pending) {
/*
* Create a UAContext for a Job that is running so that
- * it can the User Agent routines and
+ * it can the User Agent routines and
* to ensure that the Job gets the proper output.
* This is a sort of mini-kludge, and should be
* unified at some point.
if (ua->UA_sock) {
bnet_close(ua->UA_sock);
+ ua->UA_sock = NULL;
}
free(ua);
}
/*
- * Called from main Bacula thread
+ * Called from main Bacula thread
*/
void term_ua_server()
{
if (!started) {
return;
}
- quit_cmd_thread = TRUE;
}
{
BSOCK *sd;
- ua->jcr->store = store;
+ set_storage(ua->jcr, store);
/* Try connecting for up to 15 seconds */
bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d\n"),
store->hdr.name, store->address, store->SDport);
char JobName[MAX_NAME_LENGTH];
const char *termstat;
+ bstrncpy(JobName, je->Job, sizeof(JobName));
+ /* There are three periods after the Job name */
+ char *p;
+ for (int i=0; i<3; i++) {
+ if ((p=strrchr(JobName, '.')) != NULL) {
+ *p = 0;
+ }
+ }
+
+ if (!acl_access_ok(ua, Job_ACL, JobName)) {
+ continue;
+ }
+
bstrftime_nc(dt, sizeof(dt), je->end_time);
switch (je->JobType) {
case JT_ADMIN:
termstat = "Other";
break;
}
- bstrncpy(JobName, je->Job, sizeof(JobName));
- /* There are three periods after the Job name */
- char *p;
- for (int i=0; i<3; i++) {
- if ((p=strrchr(JobName, '.')) != NULL) {
- *p = 0;
- }
- }
bsendmsg(ua, _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
je->JobId,
level,
*/
/*
- Copyright (C) 2002-2004 Kern Sibbald and John Walker
+ Copyright (C) 2002-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "bacula.h"
#include "dird.h"
+#ifdef HAVE_FNMATCH
#include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
#include "findlib/find.h"
static int donecmd(UAContext *ua, TREE_CTX *tree);
-struct cmdstruct { const char *key; int (*func)(UAContext *ua, TREE_CTX *tree); const char *help; };
+struct cmdstruct { const char *key; int (*func)(UAContext *ua, TREE_CTX *tree); const char *help; };
static struct cmdstruct commands[] = {
{ N_("cd"), cdcmd, _("change current directory")},
{ N_("count"), countcmd, _("count marked files in and below the cd")},
- { N_("dir"), dircmd, _("list current directory")},
+ { N_("dir"), dircmd, _("list current directory")},
{ N_("done"), donecmd, _("leave file selection mode")},
{ N_("estimate"), estimatecmd, _("estimate restore size")},
{ N_("exit"), donecmd, _("exit = done")},
{ N_("find"), findcmd, _("find files -- wildcards allowed")},
{ N_("help"), helpcmd, _("print help")},
- { N_("ls"), lscmd, _("list current directory -- wildcards allowed")},
- { N_("lsmark"), lsmarkcmd, _("list the marked files in and below the cd")},
+ { N_("ls"), lscmd, _("list current directory -- wildcards allowed")},
+ { N_("lsmark"), lsmarkcmd, _("list the marked files in and below the cd")},
{ N_("mark"), markcmd, _("mark dir/file to be restored -- recursively in dirs")},
{ N_("markdir"), markdircmd, _("mark directory name to be restored (no files)")},
{ N_("pwd"), pwdcmd, _("print current working directory")},
{ N_("unmark"), unmarkcmd, _("unmark dir/file to be restored -- recursively in dir")},
{ N_("unmarkdir"), unmarkdircmd, _("unmark directory name only -- no recursion")},
{ N_("quit"), quitcmd, _("quit")},
- { N_("?"), helpcmd, _("print help")},
+ { N_("?"), helpcmd, _("print help")},
};
#define comsize (sizeof(commands)/sizeof(struct cmdstruct))
UAContext *ua = new_ua_context(tree->ua->jcr);
ua->UA_sock = tree->ua->UA_sock; /* patch in UA socket */
- bsendmsg(tree->ua, _(
+ bsendmsg(tree->ua, _(
"\nYou are now entering file selection mode where you add (mark) and\n"
"remove (unmark) files to be restored. No files are initially added, unless\n"
"you used the \"all\" keyword on the command line.\n"
tree->node = (TREE_NODE *)tree->root;
tree_getpath(tree->node, cwd, sizeof(cwd));
bsendmsg(tree->ua, _("cwd is: %s\n"), cwd);
- for ( ;; ) {
+ for ( ;; ) {
int found, len, i;
if (!get_cmd(ua, "$ ")) {
break;
/*
* Set extract to value passed. We recursively walk
- * down the tree setting all children if the
+ * down the tree setting all children if the
* node is a directory.
*/
static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extract)
}
/*
- * Recursively mark the current directory to be restored as
+ * Recursively mark the current directory to be restored as
* well as all directories and files below it.
*/
static int markcmd(UAContext *ua, TREE_CTX *tree)
if (count == 0) {
bsendmsg(ua, _("No files marked.\n"));
} else {
- bsendmsg(ua, _("%s file%s marked.\n"),
+ bsendmsg(ua, _("%s file%s marked.\n"),
edit_uint64_with_commas(count, ec1), count==0?"":"s");
}
return 1;
if (count == 0) {
bsendmsg(ua, _("No directories marked.\n"));
} else {
- bsendmsg(ua, _("%s director%s marked.\n"),
+ bsendmsg(ua, _("%s director%s marked.\n"),
edit_uint64_with_commas(count, ec1), count==1?"y":"ies");
}
return 1;
}
}
}
- bsendmsg(ua, "%s total files/dirs. %s marked to be restored.\n",
- edit_uint64_with_commas(total, ec1),
+ bsendmsg(ua, "%s total files/dirs. %s marked to be restored.\n",
+ edit_uint64_with_commas(total, ec1),
edit_uint64_with_commas(num_extract, ec2));
return 1;
}
bsendmsg(ua, _("No file specification given.\n"));
return 0;
}
-
+
for (int i=1; i < ua->argc; i++) {
for (TREE_NODE *node=first_tree_node(tree->root); node; node=next_tree_node(node)) {
if (fnmatch(ua->argk[i], node->fname, 0) == 0) {
{
TREE_NODE *node;
- if (!tree_node_has_child(tree->node)) {
+ if (!tree_node_has_child(tree->node)) {
return 1;
}
foreach_child(node, tree->node) {
/*
* Ls command that lists only the marked files
*/
-static void rlsmark(UAContext *ua, TREE_NODE *tnode)
+static void rlsmark(UAContext *ua, TREE_NODE *tnode)
{
TREE_NODE *node;
- if (!tree_node_has_child(tnode)) {
+ if (!tree_node_has_child(tnode)) {
return;
}
foreach_child(node, tnode) {
char buf[1100];
char cwd[1100], *pcwd;
- if (!tree_node_has_child(tree->node)) {
+ if (!tree_node_has_child(tree->node)) {
bsendmsg(ua, "Node %s has no children.\n", tree->node->fname);
return 1;
}
}
}
}
- bsendmsg(ua, "%d total files; %d marked to be restored; %s bytes.\n",
+ bsendmsg(ua, "%d total files; %d marked to be restored; %s bytes.\n",
total, num_extract, edit_uint64_with_commas(total_bytes, ec1));
return 1;
}
-static int helpcmd(UAContext *ua, TREE_CTX *tree)
+static int helpcmd(UAContext *ua, TREE_CTX *tree)
{
unsigned int i;
* we assume it is a Win32 absolute cd rather than relative and
* try a second time with /x: ... Win32 kludge.
*/
-static int cdcmd(UAContext *ua, TREE_CTX *tree)
+static int cdcmd(UAContext *ua, TREE_CTX *tree)
{
TREE_NODE *node;
char cwd[2000];
return 1;
}
-static int pwdcmd(UAContext *ua, TREE_CTX *tree)
+static int pwdcmd(UAContext *ua, TREE_CTX *tree)
{
char cwd[2000];
tree_getpath(tree->node, cwd, sizeof(cwd));
TREE_NODE *node;
int count = 0;
- if (ua->argc < 2 || !tree_node_has_child(tree->node)) {
+ if (ua->argc < 2 || !tree_node_has_child(tree->node)) {
bsendmsg(ua, _("No files unmarked.\n"));
return 1;
}
}
-static int donecmd(UAContext *ua, TREE_CTX *tree)
+static int donecmd(UAContext *ua, TREE_CTX *tree)
{
return 0;
}
-static int quitcmd(UAContext *ua, TREE_CTX *tree)
+static int quitcmd(UAContext *ua, TREE_CTX *tree)
{
ua->quit = true;
return 0;
*/
bool do_verify(JCR *jcr)
{
+ JOB_DBR jr;
const char *level, *Name;
BSOCK *fd;
- JOB_DBR jr, verify_jr;
JobId_t verify_jobid = 0;
int stat;
- memset(&verify_jr, 0, sizeof(verify_jr));
- if (!jcr->verify_jr) {
- jcr->verify_jr = &verify_jr;
- }
+ memset(&jcr->verify_jr, 0, sizeof(jcr->verify_jr));
+
if (!get_or_create_client_record(jcr)) {
goto bail_out;
}
if (jcr->JobLevel == L_VERIFY_CATALOG ||
jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG) {
- verify_jr.JobId = verify_jobid;
- if (!db_get_job_record(jcr, jcr->db, &verify_jr)) {
+ jcr->verify_jr.JobId = verify_jobid;
+ if (!db_get_job_record(jcr, jcr->db, &jcr->verify_jr)) {
Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"),
db_strerror(jcr->db));
goto bail_out;
}
- if (verify_jr.JobStatus != 'T') {
+ if (jcr->verify_jr.JobStatus != 'T') {
Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"),
- verify_jobid, verify_jr.JobStatus);
+ verify_jobid, jcr->verify_jr.JobStatus);
goto bail_out;
}
Jmsg(jcr, M_INFO, 0, _("Verifying against JobId=%d Job=%s\n"),
- verify_jr.JobId, verify_jr.Job);
+ jcr->verify_jr.JobId, jcr->verify_jr.Job);
}
/*
if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
RBSR *bsr = new_bsr();
UAContext *ua;
- bsr->JobId = verify_jr.JobId;
+ bsr->JobId = jcr->verify_jr.JobId;
ua = new_ua_context(jcr);
complete_bsr(ua, bsr);
bsr->fi = new_findex();
bsr->fi->findex = 1;
- bsr->fi->findex2 = verify_jr.JobFiles;
+ bsr->fi->findex2 = jcr->verify_jr.JobFiles;
jcr->ExpectedFiles = write_bsr_file(ua, bsr);
if (jcr->ExpectedFiles == 0) {
free_ua_context(ua);
if (jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG && jcr->verify_job) {
jcr->fileset = jcr->verify_job->fileset;
}
- Dmsg2(100, "ClientId=%u JobLevel=%c\n", verify_jr.ClientId, jcr->JobLevel);
+ Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->verify_jr.ClientId, jcr->JobLevel);
/*
* OK, now connect to the File daemon
jcr->fileset->hdr.name,
level_to_str(jcr->JobLevel),
jcr->client->hdr.name,
- jcr->verify_jr->JobId,
+ jcr->verify_jr.JobId,
Name,
sdt,
edt,
jcr->fileset->hdr.name,
level_to_str(jcr->JobLevel),
jcr->client->hdr.name,
- jcr->verify_jr->JobId,
+ jcr->verify_jr.JobId,
Name,
sdt,
edt,
*/
fdbr.FileId = 0;
if (!db_get_file_attributes_record(jcr, jcr->db, jcr->fname,
- jcr->verify_jr, &fdbr)) {
+ &jcr->verify_jr, &fdbr)) {
Jmsg(jcr, M_INFO, 0, _("New file: %s\n"), jcr->fname);
Dmsg1(020, _("File not in catalog: %s\n"), jcr->fname);
stat = JS_Differences;
static int save_file(FF_PKT *ff_pkt, void *pkt);
+/*** FIXME ***/
+#ifdef HAVE_ACL
+static int read_send_acl(JCR *jcr, BSOCK *sd, int acltype, int stream);
+#endif
+
/*
* Find all the requested files and send them
* to the Storage daemon.
}
#ifdef HAVE_ACL
- /* ACL stream */
- if (ff_pkt->flags & FO_ACL) {
- char *acl_text;
- /* Read ACLs for files, dirs and links */
- if (ff_pkt->type == FT_DIREND) {
- /* Directory: Try for default ACL*/
- acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_DEFAULT);
- if (!myAcl) {
- Dmsg1(200, "No default ACL defined for directory: %s!\n", ff_pkt->fname);
- /* If there is no default ACL get standard ACL */
- myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
- if (!myAcl) {
- Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of directory: %s!\n", ff_pkt->fname);
- }
- }
- acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
- /* Free memory */
- acl_free(myAcl);
+ /*** FIXME ***/
+ if (ff_pkt->flags & FO_ACL) {
+ /* Storing of ACLs for Links is not needed, because: ACL of link == ACL of original */
+ if(ff_pkt->type != FT_LNK) {
+ /* Read access ACLs for files, dirs and links */
+ if (!read_send_acl(jcr, sd, ACL_TYPE_ACCESS, STREAM_UNIX_ATTRIBUTES_ACCESS_ACL)) {
+ return 0;
+ }
+ /* Directories can have also default ACLs*/
+ if (ff_pkt->type == FT_DIREND) {
+ if (!read_send_acl(jcr, sd, ACL_TYPE_DEFAULT, STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL)) {
+ return 0;
+ }
+ }
} else {
- /* Files or links */
- acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
- if (!myAcl) {
- Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of file: %s!\n", ff_pkt->fname);
- acl_free(myAcl);
- }
- acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
- acl_free(myAcl);
- }
-
- /* If there is an ACL, send it to the Storage daemon */
- if (acl_text) {
- sd = jcr->store_bsock;
- pm_strcpy(&jcr->last_fname, ff_pkt->fname);
-
- /*
- * Send ACL header
- *
- */
- if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES_ACL)) {
- berrno be;
- Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
- bnet_strerror(sd));
- return 0;
- }
-
- /* Send the buffer to the storage deamon */
- msgsave = sd->msg;
- sd->msg = acl_text;
- sd->msglen = strlen(acl_text) + 1;
- if (!bnet_send(sd)) {
- berrno be;
- sd->msg = msgsave;
- sd->msglen = 0;
- bclose(&ff_pkt->bfd);
- Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
- bnet_strerror(sd));
- } else {
- jcr->JobBytes += sd->msglen;
- sd->msg = msgsave;
- bclose(&ff_pkt->bfd);
- if (!bnet_sig(sd, BNET_EOD)) {
- berrno be;
- Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
- bnet_strerror(sd));
- } else {
- Dmsg1(200, "ACL of file: %s successfully backed up!\n", ff_pkt->fname);
- }
- }
+ Dmsg1(200, "No need to store ACLs from Links!\n", jcr->last_fname);
}
}
+
#endif
/* Terminate any MD5 signature and send it to Storage daemon and the Director */
}
return 1;
}
+
+#ifdef HAVE_ACL
+/*
+* Read and send an ACL for the last encountered file.
+*/
+int read_send_acl(JCR *jcr, BSOCK *sd, int acltype, int stream)
+{
+ POOLMEM *msgsave;
+ char *acl_text = NULL;
+ acl_t acl;
+
+ /* Read access ACLs for files, dirs and links */
+ acl = acl_get_file(jcr->last_fname, acltype);
+ if (!acl) {
+ Jmsg1(jcr, M_WARNING, 0, "Error while trying to get ACL of %s!\n", jcr->last_fname);
+ return 0;
+ }
+
+ acl_text = acl_to_any_text(acl, NULL, ',', TEXT_ABBREVIATE);
+
+ /* Check if ACL is valid */
+ if ((acl_valid(acl) != 0) && (acltype != ACL_TYPE_DEFAULT)) {
+ Jmsg1(jcr, M_WARNING, 0, "Failure in the ACL of %s! FD is not able to back it up!\n", jcr->last_fname);
+ Dmsg1(200, "ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+ Dmsg1(200, "ACL value=%s\n", acl_text);
+ } else if (acl_valid(acl) == 0) {
+ Dmsg1(200, "ACL of file/dir: %s is valid!\n", jcr->last_fname);
+ Dmsg1(200, "ACL value=%s\n", acl_text);
+ } else {
+ Dmsg1(200, "Directory: %s has no Default ACL, there is nothing to do from here!\n", jcr->last_fname);
+ acl_free(acl);
+ return 0;
+ }
+ acl_free(acl);
+
+ if (acl_text == NULL) {
+ /* ***FIXME*** Can this happen? */
+ Jmsg1(jcr, M_WARNING, 0, "Error decoding ACL of %s!\n", jcr->last_fname);
+ return 0;
+ }
+
+ if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream)) {
+ berrno be;
+ Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+ return 0;
+ }
+
+ /* Send the buffer to the storage deamon */
+ msgsave = sd->msg;
+ sd->msg = acl_text;
+ sd->msglen = strlen(acl_text) + 1;
+ if (!bnet_send(sd)) {
+ berrno be;
+ sd->msg = msgsave;
+ sd->msglen = 0;
+ Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+ return 0;
+ }
+
+ jcr->JobBytes += sd->msglen;
+ sd->msg = msgsave;
+ if (!bnet_sig(sd, BNET_EOD)) {
+ berrno be;
+ Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd));
+ return 0;
+ }
+
+ Dmsg1(200, "ACL of file: %s successfully backed up!\n", jcr->last_fname);
+ return 1;
+ }
+#endif
/*
- * Bacula File Daemon estimate.c
+ * Bacula File Daemon estimate.c
* Make and estimate of the number of files and size to be saved.
*
* Kern Sibbald, September MMI
static int tally_file(FF_PKT *ff_pkt, void *pkt);
-/*
+/*
* Find all the requested files and count them.
*/
int make_estimate(JCR *jcr)
stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr);
return stat;
-}
+}
-/*
+/*
* Called here by find() for each file included.
*
*/
case FT_REGE:
case FT_REG:
case FT_LNK:
+ case FT_NORECURSE:
+ case FT_NOFSCHG:
+ case FT_INVALIDFS:
case FT_DIREND:
case FT_SPEC:
case FT_RAW:
case FT_DIRNOCHG:
case FT_NOCHG:
case FT_ISARCH:
- case FT_NORECURSE:
- case FT_NOFSCHG:
case FT_NOOPEN:
default:
return 1;
}
- if (ff_pkt->type != FT_LNKSAVED && S_ISREG(ff_pkt->statp.st_mode) &&
- ff_pkt->statp.st_size > 0) {
- jcr->JobBytes += ff_pkt->statp.st_size;
+ if (ff_pkt->type != FT_LNKSAVED && S_ISREG(ff_pkt->statp.st_mode)) {
+ if (ff_pkt->statp.st_size > 0) {
+ jcr->JobBytes += ff_pkt->statp.st_size;
+ }
+#ifdef HAVE_DARWIN_OS
+ if (ff_pkt->flags & FO_HFSPLUS) {
+ if (ff_pkt->hfsinfo.rsrclength > 0) {
+ jcr->JobBytes += ff_pkt->hfsinfo.rsrclength;
+ }
+ jcr->JobBytes += 32; /* Finder info */
+ }
+#endif
}
jcr->num_files_examined++;
jcr->JobFiles++; /* increment number of files seen */
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static void usage()
{
- fprintf(stderr, _(
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker\n"
+ Pmsg0(-1, _(
+"Copyright (C) 2000-2005 Kern Sibbald\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bacula-fd [-f -s] [-c config_file] [-d debug_level]\n"
+"Usage: bacula-fd [-f -s] [-c config_file] [-d debug_level]\n"
" -c <file> use <file> as configuration file\n"
" -dnn set debug level to nn\n"
" -f run in foreground (for debugging)\n"
" -u userid\n"
" -v verbose user messages\n"
" -? print this message.\n"
-"\n"));
+"\n"));
exit(1);
}
-/*********************************************************************
+/*********************************************************************
*
- * Main Bacula Unix Client Program
+ * Main Bacula Unix Client Program
*
*/
#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0) {
- debug_level = 1;
+ debug_level = 1;
}
break;
default:
usage();
- }
+ }
}
argc -= optind;
argv += optind;
if (configfile != NULL)
free(configfile);
configfile = bstrdup(*argv);
- argc--;
+ argc--;
argv++;
}
if (argc) {
me = (CLIENT *)GetNextRes(R_CLIENT, NULL);
UnlockRes();
if (!me) {
- Emsg1(M_ABORT, 0, _("No File daemon resource defined in %s\n\
-Without that I don't know who I am :-(\n"), configfile);
+ Emsg1(M_ABORT, 0, _("No File daemon resource defined in %s\n"
+"Without that I don't know who I am :-(\n"), configfile);
} else {
my_name_is(0, NULL, me->hdr.name);
if (!me->messages) {
server_tid = pthread_self();
if (inetd_request) {
- /* Socket is on fd 0 */
+ /* Socket is on fd 0 */
struct sockaddr client_addr;
int port = -1;
socklen_t client_addr_len = sizeof(client_addr);
free(configfile);
}
if (debug_level > 5) {
- print_memory_pool_stats();
+ print_memory_pool_stats();
}
free_config_resources();
term_msg();
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
extern char my_name[];
extern CLIENT *me; /* our client resource */
-
+
/* Imported functions */
extern int status_cmd(JCR *jcr);
extern int qstatus_cmd(JCR *jcr);
static int send_bootstrap_file(JCR *jcr);
static int runbefore_cmd(JCR *jcr);
static int runafter_cmd(JCR *jcr);
-static int run_cmd(JCR *jcr, char *cmd, const char *name);
+static bool run_cmd(JCR *jcr, char *cmd, const char *name);
static void set_options(findFOPTS *fo, const char *opts);
int monitoraccess; /* specify if monitors have access to this function */
};
-/*
- * The following are the recognized commands from the Director.
+/*
+ * The following are the recognized commands from the Director.
*/
static struct s_cmds cmds[] = {
{"backup", backup_cmd, 0},
static char read_data[] = "read data %d\n";
static char read_close[] = "read close session %d\n";
-/*
+/*
* Accept requests from a Director
*
* NOTE! We are running as a separate thread
*/
void *handle_client_request(void *dirp)
{
- int i;
+ int i;
bool found, quit;
JCR *jcr;
BSOCK *dir = (BSOCK *)dirp;
}
Dmsg1(100, "Executing %s command.\n", cmds[i].cmd);
if (!cmds[i].func(jcr)) { /* do command */
- quit = true; /* error or fully terminated, get out */
+ quit = true; /* error or fully terminated, get out */
Dmsg0(20, "Quit command loop due to command error or Job done.\n");
}
break;
regfree((regex_t *)fo->regex.get(k));
}
fo->regex.destroy();
+ fo->regexdir.destroy();
+ fo->regexfile.destroy();
fo->wild.destroy();
+ fo->wilddir.destroy();
+ fo->wildfile.destroy();
fo->base.destroy();
+ fo->fstype.destroy();
if (fo->reader) {
free(fo->reader);
}
for (j=0; j<incexe->opts_list.size(); j++) {
findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
fo->regex.destroy();
+ fo->regexdir.destroy();
+ fo->regexfile.destroy();
fo->wild.destroy();
+ fo->wilddir.destroy();
+ fo->wildfile.destroy();
fo->base.destroy();
+ fo->fstype.destroy();
}
incexe->opts_list.destroy();
incexe->name_list.destroy();
}
/*
- * Hello from Director he must identify himself and provide his
+ * Hello from Director he must identify himself and provide his
* password.
*/
static int hello_cmd(JCR *jcr)
P(cjcr->mutex);
cjcr->store_bsock->timed_out = 1;
cjcr->store_bsock->terminated = 1;
-/*
+/*
* #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
*/
#if !defined(HAVE_CYGWIN)
if (sscanf(dir->msg, "setdebug=%d trace=%d", &level, &trace_flag) != 2 || level < 0) {
pm_strcpy(jcr->errmsg, dir->msg);
bnet_fsend(dir, "2991 Bad setdebug command: %s\n", jcr->errmsg);
- return 0;
+ return 0;
}
debug_level = level;
set_trace(trace_flag);
return 0;
}
make_estimate(jcr);
- bnet_fsend(dir, OKest, jcr->num_files_examined,
+ bnet_fsend(dir, OKest, jcr->num_files_examined,
edit_uint64_with_commas(jcr->JobBytes, ed2));
bnet_sig(dir, BNET_EOD);
return 1;
POOLMEM *sd_auth_key;
sd_auth_key = get_memory(dir->msglen);
- if (sscanf(dir->msg, jobcmd, &jcr->JobId, jcr->Job,
+ if (sscanf(dir->msg, jobcmd, &jcr->JobId, jcr->Job,
&jcr->VolSessionId, &jcr->VolSessionTime,
sd_auth_key) != 5) {
pm_strcpy(jcr->errmsg, dir->msg);
static int runbefore_cmd(JCR *jcr)
{
- int stat;
+ bool ok;
BSOCK *dir = jcr->dir_bsock;
POOLMEM *cmd = get_memory(dir->msglen+1);
unbash_spaces(cmd);
/* Run the command now */
- stat = run_cmd(jcr, cmd, "ClientRunBeforeJob");
+ ok = run_cmd(jcr, cmd, "ClientRunBeforeJob");
free_memory(cmd);
- if (stat) {
+ if (ok) {
bnet_fsend(dir, OKRunBefore);
return 1;
} else {
return bnet_fsend(dir, OKRunAfter);
}
-static int run_cmd(JCR *jcr, char *cmd, const char *name)
+static bool run_cmd(JCR *jcr, char *cmd, const char *name)
{
POOLMEM *ecmd = get_pool_memory(PM_FNAME);
int status;
BPIPE *bpipe;
char line[MAXSTRING];
-
+
ecmd = edit_job_codes(jcr, ecmd, cmd, "");
bpipe = open_bpipe(ecmd, 0, "r");
free_pool_memory(ecmd);
if (bpipe == NULL) {
- Jmsg(jcr, M_FATAL, 0, _("%s could not execute\n"), name);
- set_jcr_job_status(jcr, JS_FatalError);
- return 0;
+ berrno be;
+ Jmsg(jcr, M_FATAL, 0, _("%s could not execute. ERR=%s\n"), name,
+ be.strerror());
+ return false;
}
while (fgets(line, sizeof(line), bpipe->rfd)) {
- Jmsg(jcr, M_INFO, 0, _("%s: %s"), name, line);
+ int len = strlen(line);
+ if (len > 0 && line[len-1] == '\n') {
+ line[len-1] = 0;
+ }
+ Jmsg(jcr, M_INFO, 0, _("%s: %s\n"), name, line);
}
status = close_bpipe(bpipe);
if (status != 0) {
- Jmsg(jcr, M_FATAL, 0, _("%s returned non-zero status=%d\n"), name,
- status);
- set_jcr_job_status(jcr, JS_FatalError);
- return 0;
+ berrno be;
+ Jmsg(jcr, M_FATAL, 0, _("%s returned non-zero status=%d. ERR=%s\n"), name,
+ status, be.strerror(status));
+ return false;
}
- return 1;
+ return true;
}
/* Copy File options */
if (list == INC_LIST) {
*q = 0; /* terminate options */
- strcpy(buf, fname);
- strcat(buf, " ");
+ bstrncpy(buf, fname, sizeof(buf));
+ bstrncat(buf, " ", sizeof(buf));
optlen = strlen(buf);
} else {
optlen = 0;
/* Copy File options */
if (list == INC_LIST) {
*q = 0; /* terminate options */
- strcpy(buf, fname);
- strcat(buf, " ");
+ bstrncpy(buf, fname, sizeof(buf));
+ bstrncat(buf, " ", sizeof(buf));
optlen = strlen(buf);
} else {
optlen = 0;
}
}
-/*
- *
+/*
+ *
* Get list of files/directories to include from Director
*
*/
return bnet_fsend(dir, OKinc);
}
-static bool init_fileset(JCR *jcr)
+static bool init_fileset(JCR *jcr)
{
FF_PKT *ff;
findFILESET *fileset;
- if (!jcr->ff) {
+ if (!jcr->ff) {
return false;
}
ff = (FF_PKT *)jcr->ff;
findFOPTS *fo = (findFOPTS *)malloc(sizeof(findFOPTS));
memset(fo, 0, sizeof(findFOPTS));
fo->regex.init(1, true);
+ fo->regexdir.init(1, true);
+ fo->regexfile.init(1, true);
fo->wild.init(1, true);
+ fo->wilddir.init(1, true);
+ fo->wildfile.init(1, true);
fo->base.init(1, true);
+ fo->fstype.init(1, true);
incexe->current_opts = fo;
incexe->opts_list.append(fo);
}
}
break;
case '<':
+ Dmsg0(100, "Doing < include on client.\n");
p++; /* skip over < */
if ((ffd = fopen(p, "r")) == NULL) {
berrno be;
}
while (fgets(buf, sizeof(buf), ffd)) {
strip_trailing_junk(buf);
+ Dmsg1(100, "%s\n", buf);
fileset->incexe->name_list.append(bstrdup(buf));
}
fclose(ffd);
}
}
-
+
static void add_fileset(JCR *jcr, const char *item)
{
FF_PKT *ff = (FF_PKT *)jcr->ff;
int state = fileset->state;
findFOPTS *current_opts;
+ /* Get code, optional subcode, and position item past the dividing space */
Dmsg1(100, "%s\n", item);
int code = item[0];
- if (item[1] == ' ') { /* If string follows */
- item += 2; /* point to string */
+ if (code != '\0') {
+ ++item;
+ }
+ int subcode = ' '; /* A space is always a valid subcode */
+ if (item[0] != '\0' && item[0] != ' ') {
+ subcode = item[0];
+ ++item;
+ }
+ if (*item == ' ') {
+ ++item;
}
+ /* Skip all lines we receive after an error */
if (state == state_error) {
return;
}
+
+ /*
+ * The switch tests the code for validity.
+ * The subcode is always good if it is a space, otherwise we must confirm.
+ * We set state to state_error first assuming the subcode is invalid,
+ * requiring state to be set in cases below that handle subcodes.
+ */
+ if (subcode != ' ') {
+ state = state_error;
+ }
switch (code) {
case 'I':
/* New include */
int rc;
char prbuf[500];
preg = (regex_t *)malloc(sizeof(regex_t));
- rc = regcomp(preg, item, REG_EXTENDED);
+ if (current_opts->flags & FO_IGNORECASE) {
+ rc = regcomp(preg, item, REG_EXTENDED|REG_ICASE);
+ } else {
+ rc = regcomp(preg, item, REG_EXTENDED);
+ }
if (rc != 0) {
regerror(rc, preg, prbuf, sizeof(prbuf));
regfree(preg);
state = state_error;
break;
}
- current_opts->regex.append(preg);
state = state_options;
+ if (subcode == ' ') {
+ current_opts->regex.append(preg);
+ } else if (subcode == 'D') {
+ current_opts->regexdir.append(preg);
+ } else if (subcode == 'F') {
+ current_opts->regexfile.append(preg);
+ } else {
+ state = state_error;
+ }
break;
case 'B':
current_opts = start_options(ff);
current_opts->base.append(bstrdup(item));
state = state_options;
break;
+ case 'X':
+ current_opts = start_options(ff);
+ current_opts->fstype.append(bstrdup(item));
+ state = state_options;
+ break;
case 'W':
current_opts = start_options(ff);
- current_opts->wild.append(bstrdup(item));
state = state_options;
+ if (subcode == ' ') {
+ current_opts->wild.append(bstrdup(item));
+ } else if (subcode == 'D') {
+ current_opts->wilddir.append(bstrdup(item));
+ } else if (subcode == 'F') {
+ current_opts->wildfile.append(bstrdup(item));
+ } else {
+ state = state_error;
+ }
break;
- case 'O':
+ case 'O':
current_opts = start_options(ff);
set_options(current_opts, item);
state = state_options;
for (k=0; k<fo->regex.size(); k++) {
Dmsg1(400, "R %s\n", (char *)fo->regex.get(k));
}
+ for (k=0; k<fo->regexdir.size(); k++) {
+ Dmsg1(400, "RD %s\n", (char *)fo->regexdir.get(k));
+ }
+ for (k=0; k<fo->regexfile.size(); k++) {
+ Dmsg1(400, "RF %s\n", (char *)fo->regexfile.get(k));
+ }
for (k=0; k<fo->wild.size(); k++) {
Dmsg1(400, "W %s\n", (char *)fo->wild.get(k));
}
+ for (k=0; k<fo->wilddir.size(); k++) {
+ Dmsg1(400, "WD %s\n", (char *)fo->wilddir.get(k));
+ }
+ for (k=0; k<fo->wildfile.size(); k++) {
+ Dmsg1(400, "WF %s\n", (char *)fo->wildfile.get(k));
+ }
for (k=0; k<fo->base.size(); k++) {
Dmsg1(400, "B %s\n", (char *)fo->base.get(k));
}
+ for (k=0; k<fo->fstype.size(); k++) {
+ Dmsg1(400, "X %s\n", (char *)fo->fstype.get(k));
+ }
if (fo->reader) {
Dmsg1(400, "D %s\n", fo->reader);
}
for (k=0; k<fo->regex.size(); k++) {
Dmsg1(400, "R %s\n", (char *)fo->regex.get(k));
}
+ for (k=0; k<fo->regexdir.size(); k++) {
+ Dmsg1(400, "RD %s\n", (char *)fo->regexdir.get(k));
+ }
+ for (k=0; k<fo->regexfile.size(); k++) {
+ Dmsg1(400, "RF %s\n", (char *)fo->regexfile.get(k));
+ }
for (k=0; k<fo->wild.size(); k++) {
Dmsg1(400, "W %s\n", (char *)fo->wild.get(k));
}
+ for (k=0; k<fo->wilddir.size(); k++) {
+ Dmsg1(400, "WD %s\n", (char *)fo->wilddir.get(k));
+ }
+ for (k=0; k<fo->wildfile.size(); k++) {
+ Dmsg1(400, "WF %s\n", (char *)fo->wildfile.get(k));
+ }
for (k=0; k<fo->base.size(); k++) {
Dmsg1(400, "B %s\n", (char *)fo->base.get(k));
}
+ for (k=0; k<fo->fstype.size(); k++) {
+ Dmsg1(400, "X %s\n", (char *)fo->fstype.get(k));
+ }
}
for (j=0; j<incexe->name_list.size(); j++) {
Dmsg1(400, "F %s\n", (char *)incexe->name_list.get(j));
case 'h': /* no recursion */
fo->flags |= FO_NO_RECURSION;
break;
+ case 'H': /* no hard link handling */
+ fo->flags |= FO_NO_HARDLINK;
+ break;
+ case 'i':
+ fo->flags |= FO_IGNORECASE;
+ break;
case 'M': /* MD5 */
fo->flags |= FO_MD5;
break;
case 'p': /* use portable data format */
fo->flags |= FO_PORTABLE;
break;
+ case 'R': /* Resource forks and Finder Info */
+ fo->flags |= FO_HFSPLUS;
case 'r': /* read fifo */
fo->flags |= FO_READFIFO;
break;
break;
}
}
-}
+}
/*
- * Director is passing his Fileset
+ * Director is passing his Fileset
*/
static int fileset_cmd(JCR *jcr)
{
bs = fopen(fname, "a+"); /* create file */
if (!bs) {
berrno be;
- /*
+ /*
* Suck up what he is sending to us so that he will then
* read our error message.
*/
{
BSOCK *dir = jcr->dir_bsock;
POOLMEM *level, *buf = NULL;
- struct tm tm;
- time_t mtime;
int mtime_only;
level = get_memory(dir->msglen+1);
/* Base backup requested? */
if (strcmp(level, "base") == 0) {
jcr->JobLevel = L_BASE;
- /* Full backup requested? */
+ /* Full backup requested? */
} else if (strcmp(level, "full") == 0) {
jcr->JobLevel = L_FULL;
- /*
- * Backup requested since <date> <time>
- * This form is also used for incremental and differential
- * This code is deprecated. See since_utime for new code.
- */
- } else if (strcmp(level, "since") == 0) {
- jcr->JobLevel = L_SINCE;
- if (sscanf(dir->msg, "level = since %d-%d-%d %d:%d:%d mtime_only=%d",
- &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
- &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &mtime_only) != 7) {
- goto bail_out;
- }
- tm.tm_year -= 1900;
- tm.tm_mon -= 1;
- tm.tm_wday = tm.tm_yday = 0;
- tm.tm_isdst = -1;
- mtime = mktime(&tm);
- Dmsg2(100, "Got since time: %s mtime_only=%d\n", ctime(&mtime), mtime_only);
- jcr->incremental = 1; /* set incremental or decremental backup */
- jcr->mtime = mtime; /* set since time */
+ } else if (strcmp(level, "differential") == 0) {
+ jcr->JobLevel = L_DIFFERENTIAL;
+ free_memory(level);
+ return 1;
+ } else if (strcmp(level, "incremental") == 0) {
+ jcr->JobLevel = L_INCREMENTAL;
+ free_memory(level);
+ return 1;
/*
* We get his UTC since time, then sync the clocks and correct it
* to agree with our clock.
buf = get_memory(dir->msglen+1);
utime_t since_time, adj;
btime_t his_time, bt_start, rt=0, bt_adj=0;
- jcr->JobLevel = L_SINCE;
- if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d",
- buf, &mtime_only) != 2) {
+ if (jcr->JobLevel == L_NONE) {
+ jcr->JobLevel = L_SINCE; /* if no other job level set, do it now */
+ }
+ if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d",
+ buf, &mtime_only) != 2) {
goto bail_out;
}
since_time = str_to_uint64(buf); /* this is the since time */
char ed1[50], ed2[50];
- /*
- * Sync clocks by polling him for the time. We take
+ /*
+ * Sync clocks by polling him for the time. We take
* 10 samples of his time throwing out the first two.
*/
for (int i=0; i<10; i++) {
adj = btime_to_utime(bt_adj);
since_time += adj; /* adjust for clock difference */
if (adj != 0) {
- Jmsg(jcr, M_INFO, 0, _("Since time adjusted by %d seconds.\n"), adj);
+ Jmsg(jcr, M_INFO, 0, _("DIR and FD clocks differ by %d seconds, FD automatically adjusting.\n"), adj);
}
bnet_sig(dir, BNET_EOD);
Dmsg1(100, "SessionCmd: %s", dir->msg);
if (sscanf(dir->msg, sessioncmd, jcr->VolumeName,
&jcr->VolSessionId, &jcr->VolSessionTime,
- &jcr->StartFile, &jcr->EndFile,
+ &jcr->StartFile, &jcr->EndFile,
&jcr->StartBlock, &jcr->EndBlock) != 7) {
pm_strcpy(jcr->errmsg, dir->msg);
Jmsg(jcr, M_FATAL, 0, "Bad session command: %s", jcr->errmsg);
Dmsg3(110, "Open storage: %s:%d ssl=%d\n", jcr->stored_addr, stored_port, enable_ssl);
/* Open command communications with Storage daemon */
/* Try to connect for 1 hour at 10 second intervals */
- sd = bnet_connect(jcr, 10, (int)me->SDConnectTimeout, _("Storage daemon"),
+ sd = bnet_connect(jcr, 10, (int)me->SDConnectTimeout, _("Storage daemon"),
jcr->stored_addr, NULL, stored_port, 1);
if (sd == NULL) {
Jmsg(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
}
-/*
+/*
* Do a backup. For now, we handle only Full and Incremental.
*/
static int backup_cmd(JCR *jcr)
-{
+{
BSOCK *dir = jcr->dir_bsock;
BSOCK *sd = jcr->store_bsock;
int ok = 0;
bnet_fsend(dir, OKbackup);
Dmsg1(110, "bfiled>dird: %s", dir->msg);
- /*
+ /*
* Send Append Open Session to Storage daemon
*/
bnet_fsend(sd, append_open);
Dmsg1(110, ">stored: %s", sd->msg);
- /*
+ /*
* Expect to receive back the Ticket number
*/
if (bget_msg(sd) >= 0) {
goto cleanup;
}
- /*
+ /*
* Send Append data command to Storage daemon
*/
bnet_fsend(sd, append_data, jcr->Ticket);
Dmsg1(110, ">stored: %s", sd->msg);
- /*
- * Expect to get OK data
+ /*
+ * Expect to get OK data
*/
Dmsg1(110, "<stored: %s", sd->msg);
if (!response(jcr, sd, OK_data, "Append Data")) {
goto cleanup;
}
-
+
/*
* Send Files to Storage daemon
*/
bnet_suppress_error_messages(sd, 1);
goto cleanup; /* bail out now */
}
- /*
+ /*
* Expect to get response to append_data from Storage daemon
*/
if (!response(jcr, sd, OK_append, "Append Data")) {
set_jcr_job_status(jcr, JS_ErrorTerminated);
goto cleanup;
}
-
- /*
+
+ /*
* Send Append End Data to Storage daemon
*/
bnet_fsend(sd, append_end, jcr->Ticket);
}
cleanup:
- bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
- edit_uint64(jcr->ReadBytes, ed1),
- edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
+ bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+ edit_uint64(jcr->ReadBytes, ed1),
+ edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
Dmsg1(110, "End FD msg: %s\n", dir->msg);
return 0; /* return and stop command loop */
}
-/*
+/*
* Do a Verify for Director
*
*/
static int verify_cmd(JCR *jcr)
-{
+{
BSOCK *dir = jcr->dir_bsock;
BSOCK *sd = jcr->store_bsock;
char level[100], ed1[50], ed2[50];
jcr->JobType = JT_VERIFY;
if (sscanf(dir->msg, verifycmd, level) != 1) {
bnet_fsend(dir, "2994 Bad verify command: %s\n", dir->msg);
- return 0;
+ return 0;
}
if (strcasecmp(level, "init") == 0) {
jcr->JobLevel = L_VERIFY_INIT;
jcr->JobLevel = L_VERIFY_DATA;
} else if (strcasecmp(level, "disk_to_catalog") == 0) {
jcr->JobLevel = L_VERIFY_DISK_TO_CATALOG;
- } else {
+ } else {
bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
- return 0;
+ return 0;
}
bnet_fsend(dir, OKverify);
start_dir_heartbeat(jcr);
do_verify_volume(jcr);
stop_dir_heartbeat(jcr);
- /*
+ /*
* Send Close session command to Storage daemon
*/
bnet_fsend(sd, read_close, jcr->Ticket);
break;
default:
bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
- return 0;
+ return 0;
}
bnet_sig(dir, BNET_EOD);
/* Send termination status back to Dir */
- bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
- edit_uint64(jcr->ReadBytes, ed1),
- edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
+ bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+ edit_uint64(jcr->ReadBytes, ed1),
+ edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
/* Inform Director that we are done */
bnet_sig(dir, BNET_TERMINATE);
return 0; /* return and terminate command loop */
}
-/*
+/*
* Do a Restore for Director
*
*/
static int restore_cmd(JCR *jcr)
-{
+{
BSOCK *dir = jcr->dir_bsock;
BSOCK *sd = jcr->store_bsock;
POOLMEM *where;
if (where[0] == '/' && where[1] == 0) {
where[0] = 0;
}
-
+
Dmsg2(150, "Got replace %c, where=%s\n", replace, where);
unbash_spaces(where);
jcr->where = bstrdup(where);
set_jcr_job_status(jcr, JS_Running);
- /*
+ /*
* Do restore of files and data
*/
start_dir_heartbeat(jcr);
do_restore(jcr);
stop_dir_heartbeat(jcr);
-
+
set_jcr_job_status(jcr, JS_Terminated);
if (jcr->JobStatus != JS_Terminated) {
bnet_suppress_error_messages(sd, 1);
}
- /*
+ /*
* Send Close session command to Storage daemon
*/
bnet_fsend(sd, read_close, jcr->Ticket);
set_jcr_job_status(jcr, JS_ErrorTerminated);
}
/* Send termination status back to Dir */
- bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
- edit_uint64(jcr->ReadBytes, ed1),
- edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
+ bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles,
+ edit_uint64(jcr->ReadBytes, ed1),
+ edit_uint64(jcr->JobBytes, ed2), jcr->Errors);
/* Inform Director that we are done */
bnet_sig(dir, BNET_TERMINATE);
Dmsg4(120, "VolSessId=%ld VolsessT=%ld SF=%ld EF=%ld\n",
jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile);
Dmsg2(120, "JobId=%d vol=%s\n", jcr->JobId, "DummyVolume");
- /*
+ /*
* Open Read Session with Storage daemon
*/
bnet_fsend(sd, read_open, jcr->VolumeName,
- jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile,
+ jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile,
jcr->StartBlock, jcr->EndBlock);
Dmsg1(110, ">stored: %s", sd->msg);
- /*
+ /*
* Get ticket number
*/
if (bget_msg(sd) >= 0) {
return 0;
}
- /*
+ /*
* Start read of data with Storage daemon
*/
bnet_fsend(sd, read_data, jcr->Ticket);
Dmsg1(110, ">stored: %s", sd->msg);
- /*
+ /*
* Get OK data
*/
if (!response(jcr, sd, OK_data, "Read Data")) {
return 1;
}
-/*
+/*
* Destroy the Job Control Record and associated
* resources (sockets).
*/
-static void filed_free_jcr(JCR *jcr)
+static void filed_free_jcr(JCR *jcr)
{
if (jcr->store_bsock) {
bnet_close(jcr->store_bsock);
free_pool_memory(jcr->RunAfterJob);
}
-
+
return;
}
if (strcmp(sd->msg, resp) == 0) {
return 1;
}
- }
+ }
if (job_canceled(jcr)) {
return 0; /* if canceled avoid useless error messages */
}
bs = fopen(jcr->RestoreBootstrap, "r");
if (!bs) {
berrno be;
- Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
+ Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
jcr->RestoreBootstrap, be.strerror());
set_jcr_job_status(jcr, JS_ErrorTerminated);
goto bail_out;
}
- sd->msglen = pm_strcpy(sd->msg, bootstrap);
+ sd->msglen = pm_strcpy(sd->msg, bootstrap);
bnet_send(sd);
while (fgets(buf, sizeof(buf), bs)) {
sd->msglen = Mmsg(sd->msg, "%s", buf);
- bnet_send(sd);
+ bnet_send(sd);
}
bnet_sig(sd, BNET_EOD);
fclose(bs);
#endif
break;
- case STREAM_UNIX_ATTRIBUTES_ACL:
+ case STREAM_UNIX_ATTRIBUTES_ACCESS_ACL:
#ifdef HAVE_ACL
/* Recover ACL from stream and check it */
acl = acl_from_text(sd->msg);
if (acl_valid(acl) != 0) {
- Jmsg1(jcr, M_WARNING, 0, "Failure in the ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
- acl_free(acl);
- }
-
- /* Try to restore ACL */
- if (attr->type == FT_DIREND) {
- /* Directory */
- if (acl_set_file(jcr->last_fname, ACL_TYPE_DEFAULT, acl) != 0 &&
- acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
- Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore ACL of directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
- }
- /* File or Link */
+ Jmsg1(jcr, M_WARNING, 0, "Failure in the Access ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
+ Dmsg1(200, "Acc. ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+ Dmsg1(200, "Acc. ACL value=%s\n", acl);
} else if (acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
- Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore ACL of file: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
- }
+ Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore Access ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+ Dmsg1(200, "Error! Can't restore Access ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+ Dmsg1(200, "Acc. ACL value=%s\n", acl);
+ } else {
+ Dmsg1(200, "Access ACL of file/directory: %s successfully restored!", jcr->last_fname);
+ }
acl_free(acl);
- Dmsg1(200, "ACL of file: %s successfully restored!", jcr->last_fname);
- break;
+ break;
#else
non_support_acl++;
break; /* unconfigured, ignore */
+#endif
+
+ case STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL:
+#ifdef HAVE_ACL
+ acl = acl_from_text(sd->msg);
+ if (acl_valid(acl) != 0) {
+ Jmsg1(jcr, M_WARNING, 0, "Failure in the Default ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
+ Dmsg1(200, "Def. ACL of file/dir: %s is not valid!\n", jcr->last_fname);
+ Dmsg1(200, "Def. ACL value=%s\n", acl);
+ } else if (acl_set_file(jcr->last_fname, ACL_TYPE_DEFAULT, acl) != 0) {
+ Jmsg1(jcr, M_WARNING, 0, "Error! Can't restore Default ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+ Dmsg1(200, "Error! Can't restore Default ACL of file/directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+ Dmsg1(200, "Def. ACL value=%s\n", acl);
+ } else {
+ Dmsg1(200, "Default ACL of file/directory: %s successfully restored!", jcr->last_fname);
+ }
+ acl_free(acl);
+ break;
+#else
+ non_support_acl++;
+ break;
#endif
case STREAM_MD5_SIGNATURE:
/* Forward referenced functions */
-/*
+/*
* Verify attributes of the requested files on the Volume
- *
+ *
*/
void do_verify_volume(JCR *jcr)
{
uint32_t VolSessionId, VolSessionTime, file_index;
uint32_t record_file_index;
int type, stat;
-
+
sd = jcr->store_bsock;
if (!sd) {
Jmsg(jcr, M_FATAL, 0, _("Storage command not issued before Verify.\n"));
fname = get_pool_memory(PM_FNAME);
lname = get_pool_memory(PM_FNAME);
- /*
+ /*
* Get a record from the Storage daemon
*/
while (bget_msg(sd) >= 0 && !job_canceled(jcr)) {
/*
- * First we expect a Stream Record Header
+ * First we expect a Stream Record Header
*/
if (sscanf(sd->msg, rec_header, &VolSessionId, &VolSessionTime, &file_index,
&stream, &size) != 5) {
}
Dmsg2(30, "Got hdr: FilInx=%d Stream=%d.\n", file_index, stream);
- /*
+ /*
* Now we expect the Stream Data
*/
if (bget_msg(sd) < 0) {
*fname = 0;
*lname = 0;
- /*
+ /*
* An Attributes record consists of:
* File_index
* Type (FT_types)
while (*ap++ != ' ') /* skip type */
;
/* Save filename and position to attributes */
- fp = fname;
+ fp = fname;
while (*ap != 0) {
*fp++ = *ap++; /* copy filename to fname */
}
while (*lp++ != 0) {
;
}
- strcat(lname, lp); /* "save" link name */
+ pm_strcat(lname, lp); /* "save" link name */
} else {
*lname = 0;
}
P(jcr->mutex);
jcr->JobFiles++;
jcr->num_files_examined++;
- pm_strcpy(&jcr->last_fname, fname); /* last file examined */
+ pm_strcpy(jcr->last_fname, fname); /* last file examined */
V(jcr->mutex);
- /*
+ /*
* Send file attributes to Director
* File_index
* Stream
Dmsg2(200, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, fname);
if (type == FT_LNK || type == FT_LNKSAVED) {
stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles,
- STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
+ STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
0, ap, 0, lname, 0);
} else {
stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles,
- STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
+ STREAM_UNIX_ATTRIBUTES, "pinsug5", fname,
0, ap, 0, 0);
}
Dmsg2(200, "bfiled>bdird: attribs len=%d: msg=%s\n", dir->msglen, dir->msg);
jcr->JobFiles);
Dmsg2(20, "bfiled>bdird: MD5 len=%d: msg=%s\n", dir->msglen, dir->msg);
break;
-
+
case STREAM_SHA1_SIGNATURE:
char SHA1buf[30];
bin_to_base64(SHA1buf, (char *)sd->msg, 20); /* encode 20 bytes */
Dmsg2(400, "send inx=%d SHA1=%s\n", jcr->JobFiles, SHA1buf);
- bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_SIGNATURE,
+ bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_SIGNATURE,
SHA1buf, jcr->JobFiles);
Dmsg2(20, "bfiled>bdird: SHA1 len=%d: msg=%s\n", dir->msglen, dir->msg);
break;
free_pool_memory(lname);
Dmsg2(050, "End Verify-Vol. Files=%d Bytes=%" lld "\n", jcr->JobFiles,
jcr->JobBytes);
-}
+}
#
LIBSRCS = find.c match.c find_one.c attibs.c create_file.c \
- bfile.c enable_priv.c makepath.c save-cwd.c winapi.c
+ bfile.c enable_priv.c fstype.c makepath.c save-cwd.c winapi.c
LIBOBJS = find.o match.o find_one.o attribs.o create_file.o \
- bfile.o enable_priv.o makepath.o save-cwd.o winapi.o
+ bfile.o enable_priv.o fstype.o makepath.o save-cwd.o winapi.o
.SUFFIXES: .c .o
.PHONY:
if ((bopen(bfd, attr->ofname, O_WRONLY|O_BINARY, 0)) < 0) {
berrno be;
be.set_errno(bfd->berrno);
+#ifdef HAVE_WIN32
+ /* Check for trying to create a drive, if so, skip */
+ if (attr->ofname[1] == ':' && attr->ofname[2] == '/' && attr->ofname[3] == 0) {
+ return CF_SKIP;
+ }
+#endif
Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"),
attr->ofname, be.strerror());
return CF_ERROR;
* routines for the new syntax Options resource.
*
* Kern E. Sibbald, MM
+ *
+ * Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#endif
-/*
+/*
* Initialize the find files "global" variables
*/
FF_PKT *init_find_files()
{
- FF_PKT *ff;
+ FF_PKT *ff;
ff = (FF_PKT *)bmalloc(sizeof(FF_PKT));
memset(ff, 0, sizeof(FF_PKT));
return ff;
}
-/*
+/*
* Set find_files options. For the moment, we only
* provide for full/incremental saves, and setting
* of save_time. For additional options, see above
}
-/*
+/*
* Find all specified files (determined by calls to name_add()
* This routine calls the (handle_file) subroutine with all
* sorts of good information for the final disposition of
* the file.
- *
+ *
* Call this subroutine with a callback subroutine as the first
* argument and a packet as the second argument, this packet
* will be passed back to the callback subroutine as the last
*
*/
int
-find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt)
+find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt)
{
ff->callback = callback;
findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
ff->flags |= fo->flags;
ff->GZIP_level = fo->GZIP_level;
- bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
+ ff->fstypes = fo->fstype;
+ bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts));
}
for (j=0; j<incexe->name_list.size(); j++) {
- Dmsg1(400, "F %s\n", (char *)incexe->name_list.get(j));
+ Dmsg1(100, "F %s\n", (char *)incexe->name_list.get(j));
char *fname = (char *)incexe->name_list.get(j);
if (find_one_file(jcr, ff, our_callback, his_pkt, fname, (dev_t)-1, 1) == 0) {
return 0; /* error return */
/* This is the old deprecated way */
while (!job_canceled(jcr) && (inc = get_next_included_file(ff, inc))) {
/* Copy options for this file */
- bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
- Dmsg1(50, "find_files: file=%s\n", inc->fname);
+ bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
+ Dmsg1(100, "find_files: file=%s\n", inc->fname);
if (!file_is_excluded(ff, inc->fname)) {
if (find_one_file(jcr, ff, callback, his_pkt, inc->fname, (dev_t)-1, 1) ==0) {
return 0; /* error return */
static bool accept_file(FF_PKT *ff)
{
int i, j, k;
+ int ic;
findFILESET *fileset = ff->fileset;
findINCEXE *incexe = fileset->incexe;
ff->GZIP_level = fo->GZIP_level;
ff->reader = fo->reader;
ff->writer = fo->writer;
+ ff->fstypes = fo->fstype;
+ ic = (ff->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
+ if (S_ISDIR(ff->statp.st_mode)) {
+ for (k=0; k<fo->wilddir.size(); k++) {
+ if (fnmatch((char *)fo->wilddir.get(k), ff->fname, fnmode|ic) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ Dmsg2(100, "Exclude wilddir: %s file=%s\n", (char *)fo->wilddir.get(k),
+ ff->fname);
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ } else {
+ for (k=0; k<fo->wildfile.size(); k++) {
+ if (fnmatch((char *)fo->wildfile.get(k), ff->fname, fnmode|ic) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ Dmsg2(100, "Exclude wildfile: %s file=%s\n", (char *)fo->wildfile.get(k),
+ ff->fname);
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ }
for (k=0; k<fo->wild.size(); k++) {
- if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
+ if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
if (ff->flags & FO_EXCLUDE) {
+ Dmsg2(100, "Exclude wild: %s file=%s\n", (char *)fo->wild.get(k),
+ ff->fname);
return false; /* reject file */
}
return true; /* accept file */
}
}
#ifndef WIN32
+ if (S_ISDIR(ff->statp.st_mode)) {
+ for (k=0; k<fo->regexdir.size(); k++) {
+ const int nmatch = 30;
+ regmatch_t pmatch[nmatch];
+ if (regexec((regex_t *)fo->regexdir.get(k), ff->fname, nmatch, pmatch, 0) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ } else {
+ for (k=0; k<fo->regexfile.size(); k++) {
+ const int nmatch = 30;
+ regmatch_t pmatch[nmatch];
+ if (regexec((regex_t *)fo->regexfile.get(k), ff->fname, nmatch, pmatch, 0) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ }
for (k=0; k<fo->regex.size(); k++) {
const int nmatch = 30;
regmatch_t pmatch[nmatch];
findINCEXE *incexe = (findINCEXE *)fileset->exclude_list.get(i);
for (j=0; j<incexe->opts_list.size(); j++) {
findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
+ ic = (fo->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0;
for (k=0; k<fo->wild.size(); k++) {
- if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode) == 0) {
- Dmsg1(400, "Reject wild1: %s\n", ff->fname);
+ if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) {
+ Dmsg1(100, "Reject wild1: %s\n", ff->fname);
return false; /* reject file */
}
}
}
+ ic = (incexe->current_opts != NULL && incexe->current_opts->flags & FO_IGNORECASE)
+ ? FNM_CASEFOLD : 0;
for (j=0; j<incexe->name_list.size(); j++) {
- if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode) == 0) {
- Dmsg1(400, "Reject wild2: %s\n", ff->fname);
+ if (fnmatch((char *)incexe->name_list.get(j), ff->fname, fnmode|ic) == 0) {
+ Dmsg1(100, "Reject wild2: %s\n", ff->fname);
return false; /* reject file */
}
}
/*
* The code comes here for each file examined.
* We filter the files, then call the user's callback if
- * the file is included.
+ * the file is included.
*/
static int our_callback(FF_PKT *ff, void *hpkt)
{
case FT_ISARCH:
case FT_NORECURSE:
case FT_NOFSCHG:
+ case FT_INVALIDFS:
case FT_NOOPEN:
// return ff->callback(ff, hpkt);
/*
* Terminate find_files() and release
- * all allocated memory
+ * all allocated memory
*/
int
term_find_files(FF_PKT *ff)
/*
* File types as returned by find_files()
*
- * Kern Sibbald MIM
+ * Kern Sibbald MMI
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2001-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#define MODE_RALL (S_IRUSR|S_IRGRP|S_IROTH)
-#ifdef HAVE_FNMATCH
-#include <fnmatch.h>
-#else
#include "lib/fnmatch.h"
-#endif
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
-/*
+/*
* Status codes returned by create_file()
*/
enum {
- CF_SKIP = 1, /* skip file (not newer or something) */
- CF_ERROR, /* error creating file */
- CF_EXTRACT, /* file created, data to extract */
- CF_CREATED /* file created, no data to extract */
+ CF_SKIP = 1, /* skip file (not newer or something) */
+ CF_ERROR, /* error creating file */
+ CF_EXTRACT, /* file created, data to extract */
+ CF_CREATED /* file created, no data to extract */
};
/* Options saved int "options" of the include/exclude lists.
- * They are directly jammed ito "flag" of ff packet
+ * They are directly jammed ito "flag" of ff packet
*/
-#define FO_MD5 (1<<1) /* Do MD5 checksum */
-#define FO_GZIP (1<<2) /* Do Zlib compression */
-#define FO_NO_RECURSION (1<<3) /* no recursion in directories */
-#define FO_MULTIFS (1<<4) /* multiple file systems */
-#define FO_SPARSE (1<<5) /* do sparse file checking */
-#define FO_IF_NEWER (1<<6) /* replace if newer */
-#define FO_NOREPLACE (1<<7) /* never replace */
-#define FO_READFIFO (1<<8) /* read data from fifo */
-#define FO_SHA1 (1<<9) /* Do SHA1 checksum */
-#define FO_PORTABLE (1<<10) /* Use portable data format -- no BackupWrite */
-#define FO_MTIMEONLY (1<<11) /* Use mtime rather than mtime & ctime */
-#define FO_KEEPATIME (1<<12) /* Reset access time */
-#define FO_EXCLUDE (1<<13) /* Exclude file */
-#define FO_ACL (1<<14) /* Backup ACLs */
+#define FO_MD5 (1<<1) /* Do MD5 checksum */
+#define FO_GZIP (1<<2) /* Do Zlib compression */
+#define FO_NO_RECURSION (1<<3) /* no recursion in directories */
+#define FO_MULTIFS (1<<4) /* multiple file systems */
+#define FO_SPARSE (1<<5) /* do sparse file checking */
+#define FO_IF_NEWER (1<<6) /* replace if newer */
+#define FO_NOREPLACE (1<<7) /* never replace */
+#define FO_READFIFO (1<<8) /* read data from fifo */
+#define FO_SHA1 (1<<9) /* Do SHA1 checksum */
+#define FO_PORTABLE (1<<10) /* Use portable data format -- no BackupWrite */
+#define FO_MTIMEONLY (1<<11) /* Use mtime rather than mtime & ctime */
+#define FO_KEEPATIME (1<<12) /* Reset access time */
+#define FO_EXCLUDE (1<<13) /* Exclude file */
+#define FO_ACL (1<<14) /* Backup ACLs */
+#define FO_NO_HARDLINK (1<<15) /* don't handle hard links */
+#define FO_IGNORECASE (1<<16) /* Ignore file name case */
+#define FO_HFSPLUS (1<<17) /* Resource forks and Finder Info */
struct s_included_file {
struct s_included_file *next;
- uint32_t options; /* backup options */
- int level; /* compression level */
- int len; /* length of fname */
- int pattern; /* set if wild card pattern */
- char VerifyOpts[20]; /* Options for verify */
+ uint32_t options; /* backup options */
+ int level; /* compression level */
+ int len; /* length of fname */
+ int pattern; /* set if wild card pattern */
+ char VerifyOpts[20]; /* Options for verify */
char fname[1];
};
* of the structure are passed by the Director to the
* File daemon and recompiled back into this structure
*/
-#undef MAX_FOPTS
+#undef MAX_FOPTS
#define MAX_FOPTS 30
enum {
/* File options structure */
struct findFOPTS {
- uint32_t flags; /* options in bits */
- int GZIP_level; /* GZIP level */
- char VerifyOpts[MAX_FOPTS]; /* verify options */
- alist regex; /* regex string(s) */
- alist wild; /* wild card strings */
- alist base; /* list of base names */
- char *reader; /* reader program */
- char *writer; /* writer program */
+ uint32_t flags; /* options in bits */
+ int GZIP_level; /* GZIP level */
+ char VerifyOpts[MAX_FOPTS]; /* verify options */
+ alist regex; /* regex string(s) */
+ alist regexdir; /* regex string(s) for directories */
+ alist regexfile; /* regex string(s) for files */
+ alist wild; /* wild card strings */
+ alist wilddir; /* wild card strings for directories */
+ alist wildfile; /* wild card strings for files */
+ alist base; /* list of base names */
+ alist fstype; /* file system type limitation */
+ char *reader; /* reader program */
+ char *writer; /* writer program */
};
/* This is either an include item or an exclude item */
struct findINCEXE {
- findFOPTS *current_opts; /* points to current options structure */
- alist opts_list; /* options list */
- alist name_list; /* filename list -- holds char * */
+ findFOPTS *current_opts; /* points to current options structure */
+ alist opts_list; /* options list */
+ alist name_list; /* filename list -- holds char * */
};
-/*
+/*
* FileSet Resource
*
*/
struct findFILESET {
int state;
- findINCEXE *incexe; /* current item */
+ findINCEXE *incexe; /* current item */
alist include_list;
alist exclude_list;
};
+#ifdef HAVE_DARWIN_OS
+struct HFSPLUS_INFO {
+ unsigned long length; /* Mandatory field */
+ char fndrinfo[32]; /* Finder Info */
+ off_t rsrclength; /* Size of resource fork */
+};
+#endif
/*
* Definition of the find_files packet passed as the
* first argument to the find_files callback subroutine.
*/
struct FF_PKT {
- char *fname; /* filename */
- char *link; /* link if file linked */
- POOLMEM *sys_fname; /* system filename */
- struct stat statp; /* stat packet */
- int32_t FileIndex; /* FileIndex of this file */
- int32_t LinkFI; /* FileIndex of main hard linked file */
- struct f_link *linked; /* Set if this file is hard linked */
- int type; /* FT_ type from above */
- int ff_errno; /* errno */
- BFILE bfd; /* Bacula file descriptor */
- time_t save_time; /* start of incremental time */
- bool dereference; /* follow links (not implemented) */
- bool null_output_device; /* using null output device */
- bool incremental; /* incremental save */
+ char *fname; /* filename */
+ char *link; /* link if file linked */
+ POOLMEM *sys_fname; /* system filename */
+ struct stat statp; /* stat packet */
+ int32_t FileIndex; /* FileIndex of this file */
+ int32_t LinkFI; /* FileIndex of main hard linked file */
+ struct f_link *linked; /* Set if this file is hard linked */
+ int type; /* FT_ type from above */
+ int ff_errno; /* errno */
+ BFILE bfd; /* Bacula file descriptor */
+ time_t save_time; /* start of incremental time */
+ bool dereference; /* follow links (not implemented) */
+ bool null_output_device; /* using null output device */
+ bool incremental; /* incremental save */
char VerifyOpts[20];
struct s_included_file *included_files_list;
struct s_excluded_file *excluded_files_list;
findFILESET *fileset;
int (*callback)(FF_PKT *, void *); /* User's callback */
- /* Values set by accept_file while processing Options */
- uint32_t flags; /* backup options */
- int GZIP_level; /* compression level */
- char *reader; /* reader program */
- char *writer; /* writer program */
+ /* Values set by accept_file while processing Options */
+ uint32_t flags; /* backup options */
+ int GZIP_level; /* compression level */
+ char *reader; /* reader program */
+ char *writer; /* writer program */
+ alist fstypes; /* allowed file system types */
/* List of all hard linked files found */
- struct f_link *linklist; /* hard linked files */
+ struct f_link *linklist; /* hard linked files */
+
+ /* Darwin specific things. So as not to clutter every bclose()
+ * with an #ifdef, we always include rsrc_bfd */
+ BFILE rsrc_bfd; /* fd for resource forks */
+#ifdef HAVE_DARWIN_OS
+ struct HFSPLUS_INFO hfsinfo; /* Finder Info and resource fork size */
+#endif
};
-/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+/*
+ Copyright (C) 2000-20054 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Thanks to the TAR programmers.
+ Version $Id$
+
*/
#include "bacula.h"
#include "find.h"
+#ifdef HAVE_DARWIN_OS
+#include <sys/attr.h>
+#endif
extern int32_t name_max; /* filename max length */
extern int32_t path_max; /* path name max length */
/*
- * Structure for keeping track of hard linked files, we
+ * Structure for keeping track of hard linked files, we
* keep an entry for each hardlinked file that we save,
* which is the first one found. For all the other files that
* are linked to this one, we save only the directory
}
/*
- * Find a single file.
+ * Check to see if we allow the file system type of a file or directory.
+ * If we do not have a list of file system types, we accept anything.
+ */
+static int accept_fstype(FF_PKT *ff, void *dummy) {
+ int i;
+ char fs[1000];
+ bool accept = true;
+
+ if (ff->fstypes.size()) {
+ accept = false;
+ if (!fstype(ff->fname, fs, sizeof(fs))) {
+ Dmsg1(50, "Cannot determine file system type for \"%s\"\n", ff->fname);
+ } else {
+ for (i = 0; i < ff->fstypes.size(); ++i) {
+ if (strcmp(fs, (char *)ff->fstypes.get(i)) == 0) {
+ Dmsg2(100, "Accepting fstype %s for \"%s\"\n", fs, ff->fname);
+ accept = true;
+ break;
+ }
+ Dmsg3(200, "fstype %s for \"%s\" does not match %s\n", fs,
+ ff->fname, ff->fstypes.get(i));
+ }
+ }
+ }
+ return accept;
+}
+
+/*
+ * Find a single file.
* handle_file is the callback for handling the file.
* p is the filename
- * parent_device is the device we are currently on
- * top_level is 1 when not recursing or 0 when
- * decending into a directory.
+ * parent_device is the device we are currently on
+ * top_level is 1 when not recursing or 0 when
+ * descending into a directory.
*/
int
-find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
+find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
void *pkt, char *fname, dev_t parent_device, int top_level)
{
struct utimbuf restore_times;
int rtn_stat;
+ int len;
ff_pkt->fname = ff_pkt->link = fname;
restore_times.actime = ff_pkt->statp.st_atime;
restore_times.modtime = ff_pkt->statp.st_mtime;
+ /*
+ * We check for allowed fstypes at top_level and fstype change (below).
+ */
+ if (top_level && !accept_fstype(ff_pkt, NULL)) {
+ ff_pkt->type = FT_INVALIDFS;
+ if (ff_pkt->flags & FO_KEEPATIME) {
+ utime(fname, &restore_times);
+ }
+ Jmsg1(jcr, M_ERROR, 0, _("Top level directory \"%s\" has an unlisted fstype\n"), fname);
+ return 1; /* Just ignore this error - or the whole backup is cancelled */
+ }
- /*
+ /*
* If this is an Incremental backup, see if file was modified
* since our last "save_time", presumably the last Full save
* or Incremental.
Dmsg1(300, "Non-directory incremental: %s\n", ff_pkt->fname);
/* Not a directory */
if (ff_pkt->statp.st_mtime < ff_pkt->save_time
- && ((ff_pkt->flags & FO_MTIMEONLY) ||
+ && ((ff_pkt->flags & FO_MTIMEONLY) ||
ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
/* Incremental option, file not changed */
ff_pkt->type = FT_NOCHG;
}
}
+#ifdef HAVE_DARWIN_OS
+ if (S_ISREG(ff_pkt->statp.st_mode) && ff_pkt->flags & FO_HFSPLUS) {
+ /* TODO: initialise attrList once elsewhere? */
+ struct attrlist attrList;
+ memset(&attrList, 0, sizeof(attrList));
+ attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
+ attrList.commonattr = ATTR_CMN_FNDRINFO;
+ attrList.fileattr = ATTR_FILE_RSRCLENGTH;
+ if (getattrlist(fname, &attrList, &ff_pkt->hfsinfo,
+ sizeof(ff_pkt->hfsinfo), 0) != 0) {
+ ff_pkt->type = FT_NOSTAT;
+ ff_pkt->ff_errno = errno;
+ return handle_file(ff_pkt, pkt);
+ }
+ }
+#endif
+
/* ***FIXME*** implement this */
#if xxxxxxx
/* See if we are trying to dump the archive. */
}
#endif
ff_pkt->LinkFI = 0;
- /*
+ /*
* Handle hard linked files
*
* Maintain a list of hard linked files already backed up. This
- * allows us to ensure that the data of each file gets backed
+ * allows us to ensure that the data of each file gets backed
* up only once.
*/
- if (ff_pkt->statp.st_nlink > 1
+ if (!(ff_pkt->flags & FO_NO_HARDLINK)
+ && ff_pkt->statp.st_nlink > 1
&& (S_ISREG(ff_pkt->statp.st_mode)
|| S_ISCHR(ff_pkt->statp.st_mode)
|| S_ISBLK(ff_pkt->statp.st_mode)
/* Search link list of hard linked files */
for (lp = ff_pkt->linklist; lp; lp = lp->next)
- if (lp->ino == (ino_t)ff_pkt->statp.st_ino &&
+ if (lp->ino == (ino_t)ff_pkt->statp.st_ino &&
lp->dev == (dev_t)ff_pkt->statp.st_dev) {
/* If we have already backed up the hard linked file don't do it again */
if (strcmp(lp->name, fname) == 0) {
}
/* File not previously dumped. Chain it into our list. */
- lp = (struct f_link *)bmalloc(sizeof(struct f_link) + strlen(fname) +1);
+ len = strlen(fname) + 1;
+ lp = (struct f_link *)bmalloc(sizeof(struct f_link) + len);
lp->ino = ff_pkt->statp.st_ino;
lp->dev = ff_pkt->statp.st_dev;
- strcpy(lp->name, fname);
+ bstrncpy(lp->name, fname, len);
lp->next = ff_pkt->linklist;
ff_pkt->linklist = lp;
ff_pkt->linked = lp; /* mark saved link */
size = readlink(fname, buffer, path_max + name_max + 101);
if (size < 0) {
- /* Could not follow link */
+ /* Could not follow link */
ff_pkt->type = FT_NOFOLLOW;
ff_pkt->ff_errno = errno;
rtn_stat = handle_file(ff_pkt, pkt);
struct dirent *entry, *result;
char *link;
int link_len;
- int len;
+ int len;
int status;
dev_t our_device = ff_pkt->statp.st_dev;
+ bool recurse = true;
- /*
+ /*
* If we are using Win32 (non-portable) backup API, don't check
* access as everything is more complicated, and
* in principle, we should be able to access everything.
} else {
ff_pkt->type = FT_DIRBEGIN;
}
- /*
+ /*
* Note, we return the directory to the calling program (handle_file)
- * when we first see the directory (FT_DIRBEGIN.
+ * when we first see the directory (FT_DIRBEGIN.
* This allows the program to apply matches and make a
* choice whether or not to accept it. If it is accepted, we
* do not immediately save it, but do so only after everything
dir_ff_pkt->excluded_files_list = NULL;
dir_ff_pkt->excluded_paths_list = NULL;
dir_ff_pkt->linklist = NULL;
-
- ff_pkt->link = ff_pkt->fname; /* reset "link" */
- /*
- * Do not decend into subdirectories (recurse) if the
+ /*
+ * Do not descend into subdirectories (recurse) if the
* user has turned it off for this directory.
+ *
+ * If we are crossing file systems, we are either not allowed
+ * to cross, or we may be restricted by a list of permitted
+ * file systems.
*/
if (ff_pkt->flags & FO_NO_RECURSION) {
- /* No recursion into this directory */
ff_pkt->type = FT_NORECURSE;
- rtn_stat = handle_file(ff_pkt, pkt);
- if (ff_pkt->linked) {
- ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
+ recurse = false;
+ } else if (!top_level && parent_device != ff_pkt->statp.st_dev) {
+ if(!(ff_pkt->flags & FO_MULTIFS)) {
+ ff_pkt->type = FT_NOFSCHG;
+ recurse = false;
+ } else if (!accept_fstype(ff_pkt, NULL)) {
+ ff_pkt->type = FT_INVALIDFS;
+ recurse = false;
}
- free(link);
- free_dir_ff_pkt(dir_ff_pkt);
- return rtn_stat;
}
-
- /*
- * See if we are crossing file systems, and
- * avoid doing so if the user only wants to dump one file system.
- */
- if (!top_level && !(ff_pkt->flags & FO_MULTIFS) &&
- parent_device != ff_pkt->statp.st_dev) {
- /* returning here means we do not handle this directory */
- ff_pkt->type = FT_NOFSCHG;
+ if (!recurse) {
rtn_stat = handle_file(ff_pkt, pkt);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
free(link);
free_dir_ff_pkt(dir_ff_pkt);
+ ff_pkt->link = ff_pkt->fname; /* reset "link" */
+ if (ff_pkt->flags & FO_KEEPATIME) {
+ utime(fname, &restore_times);
+ }
return rtn_stat;
}
- /*
- * Decend into or "recurse" into the directory to read
+
+ ff_pkt->link = ff_pkt->fname; /* reset "link" */
+
+ /*
+ * Descend into or "recurse" into the directory to read
* all the files in it.
*/
errno = 0;
{
struct f_link *lp, *lc;
int count = 0;
-
+
/* Free up list of hard linked files */
for (lp = ff->linklist; lp;) {
lc = lp;
--- /dev/null
+/*
+ * Implement routines to determine file system types.
+ *
+ * Written by Preben 'Peppe' Guldberg, December MMIV
+ *
+ * Version $Id$
+ */
+
+/*
+ Copyright (C) 2005 Kern Sibbald
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+#ifndef TEST_PROGRAM
+
+#include "bacula.h"
+#include "find.h"
+
+#else /* Set up for testing a stand alone program */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define SUPPORTEDOSES \
+ "HAVE_DARWIN_OS\n" \
+ "HAVE_FREEBSD_OS\n" \
+ "HAVE_HPUX_OS\n" \
+ "HAVE_IRIX_OS\n" \
+ "HAVE_LINUX_OS\n" \
+ "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 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);
+ */
+#if defined(HAVE_DARWIN_OS) \
+ || defined(HAVE_FREEBSD_OS ) \
+ || defined(HAVE_OPENBSD_OS)
+
+#include <sys/param.h>
+#include <sys/mount.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ struct statfs st;
+ if (statfs(fname, &st) == 0) {
+ bstrncpy(fs, st.f_fstypename, fslen);
+ return true;
+ }
+ Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+ return false;
+}
+#elif defined(HAVE_NETBSD_OS)
+#include <sys/param.h>
+#include <sys/mount.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ struct statvfs st;
+ if (statvfs(fname, &st) == 0) {
+ bstrncpy(fs, st.f_fstypename, fslen);
+ return true;
+ }
+ Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+ return false;
+}
+#elif defined(HAVE_HPUX_OS) \
+ || defined(HAVE_IRIX_OS)
+
+#include <sys/types.h>
+#include <sys/statvfs.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ struct statvfs st;
+ if (statvfs(fname, &st) == 0) {
+ bstrncpy(fs, st.f_basetype, fslen);
+ return true;
+ }
+ Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+ return false;
+}
+
+#elif defined(HAVE_LINUX_OS)
+
+#include <sys/vfs.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ struct statfs st;
+ if (statfs(fname, &st) == 0) {
+ /*
+ * Values nicked from statfs(2), testing and
+ *
+ * $ grep -r SUPER_MAGIC /usr/include/linux
+ *
+ * Entries are sorted on ("fsname")
+ */
+ switch (st.f_type) {
+
+ /* 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 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 0x52654973: bstrncpy(fs, "reiserfs", fslen); return true; /* REISERFS_SUPER_MAGIC */
+ case 0x58465342: bstrncpy(fs, "xfs", fslen); return true; /* XFS_SB_MAGIC */
+ case 0x9fa2: bstrncpy(fs, "usbdevfs", fslen); return true; /* USBDEVICE_SUPER_MAGIC */
+ case 0x62656572: bstrncpy(fs, "sysfs", fslen); return true; /* SYSFS_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 */
+ 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 */
+ case 0x0187: bstrncpy(fs, "autofs", fslen); return true; /* AUTOFS_SUPER_MAGIC */
+ case 0x62646576: bstrncpy(fs, "bdev", fslen); return true; /* ??? */
+ case 0x42465331: bstrncpy(fs, "befs", fslen); return true; /* BEFS_SUPER_MAGIC */
+ case 0x1BADFACE: bstrncpy(fs, "bfs", fslen); return true; /* BFS_MAGIC */
+ case 0x42494e4d: bstrncpy(fs, "binfmt_misc", fslen); return true; /* ??? */
+ case (('C'<<8)|'N'): bstrncpy(fs, "capifs", fslen); return true; /* CAPIFS_SUPER_MAGIC */
+ case 0xFF534D42: bstrncpy(fs, "cifs", fslen); return true; /* CIFS_MAGIC_NUMBER */
+ case 0x73757245: bstrncpy(fs, "coda", fslen); return true; /* CODA_SUPER_MAGIC */
+ case 0x012ff7b7: bstrncpy(fs, "coherent", fslen); return true; /* COH_SUPER_MAGIC */
+ case 0x28cd3d45: bstrncpy(fs, "cramfs", fslen); return true; /* CRAMFS_MAGIC */
+ case 0x1373: bstrncpy(fs, "devfs", fslen); return true; /* DEVFS_SUPER_MAGIC */
+ case 0x1cd1: bstrncpy(fs, "devpts", fslen); return true; /* ??? */
+ case 0x414A53: bstrncpy(fs, "efs", fslen); return true; /* EFS_SUPER_MAGIC */
+ case 0x03111965: bstrncpy(fs, "eventpollfs", fslen); return true; /* EVENTPOLLFS_MAGIC */
+ case 0x137d: bstrncpy(fs, "ext", fslen); return true; /* EXT_SUPER_MAGIC */
+ case 0xef51: bstrncpy(fs, "ext2", fslen); return true; /* EXT2_OLD_SUPER_MAGIC */
+ case 0xBAD1DEA: bstrncpy(fs, "futexfs", fslen); return true; /* ??? */
+ case 0xaee71ee7: bstrncpy(fs, "gadgetfs", fslen); return true; /* GADGETFS_MAGIC */
+ case 0x00c0ffee: bstrncpy(fs, "hostfs", fslen); return true; /* HOSTFS_SUPER_MAGIC */
+ case 0xf995e849: bstrncpy(fs, "hpfs", fslen); return true; /* HPFS_SUPER_MAGIC */
+ case 0xb00000ee: bstrncpy(fs, "hppfs", fslen); return true; /* HPPFS_SUPER_MAGIC */
+ case 0x958458f6: bstrncpy(fs, "hugetlbfs", fslen); return true; /* HUGETLBFS_MAGIC */
+ case 0x12061983: bstrncpy(fs, "hwgfs", fslen); return true; /* HWGFS_MAGIC */
+ case 0x66726f67: bstrncpy(fs, "ibmasmfs", fslen); return true; /* IBMASMFS_MAGIC */
+ case 0x9660: bstrncpy(fs, "isofs", fslen); return true; /* ISOFS_SUPER_MAGIC */
+ case 0x07c0: bstrncpy(fs, "jffs", fslen); return true; /* JFFS_MAGIC_SB_BITMASK */
+ case 0x72b6: bstrncpy(fs, "jffs2", fslen); return true; /* JFFS2_SUPER_MAGIC */
+ case 0x2468: bstrncpy(fs, "minix", fslen); return true; /* MINIX2_SUPER_MAGIC */
+ case 0x2478: bstrncpy(fs, "minix", fslen); return true; /* MINIX2_SUPER_MAGIC2 */
+ case 0x137f: bstrncpy(fs, "minix", fslen); return true; /* MINIX_SUPER_MAGIC */
+ case 0x138f: bstrncpy(fs, "minix", fslen); return true; /* MINIX_SUPER_MAGIC2 */
+ case 0x19800202: bstrncpy(fs, "mqueue", fslen); return true; /* MQUEUE_MAGIC */
+ case 0x4d44: bstrncpy(fs, "msdos", fslen); return true; /* MSDOS_SUPER_MAGIC */
+ case 0x564c: bstrncpy(fs, "ncpfs", fslen); return true; /* NCP_SUPER_MAGIC */
+ case 0x6969: bstrncpy(fs, "nfs", fslen); return true; /* NFS_SUPER_MAGIC */
+ case 0x9fa1: bstrncpy(fs, "openpromfs", fslen); return true; /* OPENPROM_SUPER_MAGIC */
+ case 0x6f70726f: bstrncpy(fs, "oprofilefs", fslen); return true; /* OPROFILEFS_MAGIC */
+ case 0xa0b4d889: bstrncpy(fs, "pfmfs", fslen); return true; /* PFMFS_MAGIC */
+ case 0x50495045: bstrncpy(fs, "pipfs", fslen); return true; /* PIPEFS_MAGIC */
+ case 0x002f: bstrncpy(fs, "qnx4", fslen); return true; /* QNX4_SUPER_MAGIC */
+ case 0x858458f6: bstrncpy(fs, "ramfs", fslen); return true; /* RAMFS_MAGIC */
+ case 0x7275: bstrncpy(fs, "romfs", fslen); return true; /* ROMFS_MAGIC */
+ case 0x858458f6: bstrncpy(fs, "rootfs", fslen); return true; /* RAMFS_MAGIC */
+ case 0x67596969: bstrncpy(fs, "rpc_pipefs", fslen); return true; /* RPCAUTH_GSSMAGIC */
+ case 0x534F434B: bstrncpy(fs, "sockfs", fslen); return true; /* SOCKFS_MAGIC */
+ case 0x012ff7b6: bstrncpy(fs, "sysv2", fslen); return true; /* SYSV2_SUPER_MAGIC */
+ case 0x012ff7b5: bstrncpy(fs, "sysv4", fslen); return true; /* SYSV4_SUPER_MAGIC */
+ case 0x858458f6: bstrncpy(fs, "tmpfs", fslen); return true; /* RAMFS_MAGIC */
+ case 0x01021994: bstrncpy(fs, "tmpfs", fslen); return true; /* TMPFS_MAGIC */
+ case 0x15013346: bstrncpy(fs, "udf", fslen); return true; /* UDF_SUPER_MAGIC */
+ case 0x00011954: bstrncpy(fs, "ufs", fslen); return true; /* UFS_MAGIC */
+ case 0xa501FCF5: bstrncpy(fs, "vxfs", fslen); return true; /* VXFS_SUPER_MAGIC */
+ case 0x012ff7b4: bstrncpy(fs, "xenix", fslen); return true; /* XENIX_SUPER_MAGIC */
+ case 0x012fd16d: bstrncpy(fs, "xiafs", fslen); return true; /* _XIAFS_SUPER_MAGIC */
+#endif
+
+ default:
+ Dmsg2(10, "Unknown file system type \"0x%x\" for \"%s\".\n", st.f_type,
+ fname);
+ return false;
+ }
+ }
+ Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
+ return false;
+}
+
+#elif defined(HAVE_SUN_OS)
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ struct stat st;
+ if (lstat(fname, &st) == 0) {
+ bstrncpy(fs, st.st_fstype, fslen);
+ return true;
+ }
+ Dmsg1(50, "lstat() failed for \"%s\"\n", fname);
+ return false;
+}
+
+#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);
+ exit(EXIT_FAILURE);
+#endif
+
+ return false;
+}
+#endif
+
+#ifdef TEST_PROGRAM
+int main(int argc, char **argv)
+{
+ char *p;
+ char fs[1000];
+ int status = 0;
+
+ if (argc < 2) {
+ 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);
+ return EXIT_FAILURE;
+ }
+ while (*++argv) {
+ if (!fstype(*argv, fs, sizeof(fs))) {
+ status = EXIT_FAILURE;
+ } else {
+ printf("%s\t%s\n", fs, *argv);
+ }
+ }
+ return status;
+}
+#endif
* filename/pathname patterns.
*
* Note, this file is used for the old style include and
- * excludes, so is deprecated. The new style code is
+ * excludes, so is deprecated. The new style code is
* found in find.c
*
* Kern E. Sibbald, December MMI
*
*/
/*
- Copyright (C) 2001-2004 Kern Sibbald and John Walker
+ Copyright (C) 2001-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
extern const int win32_client;
-
+
/*
* Initialize structures for filename matching
*/
}
/*
- * Done doing filename matching, release all
+ * Done doing filename matching, release all
* resources used.
*/
void term_include_exclude_files(FF_PKT *ff)
free(inc);
inc = next_inc;
}
+ ff->included_files_list = NULL;
for (exc=ff->excluded_files_list; exc; ) {
next_exc = exc->next;
free(exc);
exc = next_exc;
}
+ ff->excluded_files_list = NULL;
for (exc=ff->excluded_paths_list; exc; ) {
next_exc = exc->next;
free(exc);
exc = next_exc;
}
-
+ ff->excluded_paths_list = NULL;
}
/*
inc =(struct s_included_file *)bmalloc(sizeof(struct s_included_file) + len + 1);
inc->options = 0;
- inc->VerifyOpts[0] = 'V';
+ inc->VerifyOpts[0] = 'V';
inc->VerifyOpts[1] = ':';
inc->VerifyOpts[2] = 0;
rp = fname;
}
- strcpy(inc->fname, rp);
+ strcpy(inc->fname, rp);
p = inc->fname;
len = strlen(p);
/* Zap trailing slashes. */
for (next=ff->included_files_list; next->next; next=next->next)
{ }
next->next = inc;
- }
+ }
Dmsg1(50, "add_fname_to_include fname=%s\n", inc->fname);
}
} else {
list = &ff->excluded_files_list;
}
-
+
len = strlen(fname);
exc = (struct s_excluded_file *)bmalloc(sizeof(struct s_excluded_file) + len + 1);
exc->next = *list;
exc->len = len;
- strcpy(exc->fname, fname);
+ strcpy(exc->fname, fname);
#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
/* Convert any \'s into /'s */
for (char *p=exc->fname; *p; p++) {
{
struct s_included_file *inc;
- if (ainc == NULL) {
+ if (ainc == NULL) {
inc = ff->included_files_list;
} else {
inc = ainc->next;
return 1;
}
continue;
- }
+ }
/*
* No wild cards. We accept a match to the
* end of any component.
if (inc->len == len && strcmp(inc->fname, file) == 0) {
return 1;
}
- if (inc->len < len && file[inc->len] == '/' &&
+ if (inc->len < len && file[inc->len] == '/' &&
strncmp(inc->fname, file, inc->len) == 0) {
return 1;
}
{
const char *p;
- /*
+ /*
* ***NB*** this removes the drive from the exclude
* rule. Why?????
*/
/* Match from the beginning of a component only */
if ((p == file || (*p != '/' && *(p-1) == '/'))
&& file_in_excluded_list(ff->excluded_files_list, p)) {
- return 1;
+ return 1;
}
}
return 0;
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
void add_fname_to_exclude_list(FF_PKT *ff, const char *fname);
int file_is_excluded(FF_PKT *ff, const char *file);
int file_is_included(FF_PKT *ff, const char *file);
-struct s_included_file *get_next_included_file(FF_PKT *ff,
+struct s_included_file *get_next_included_file(FF_PKT *ff,
struct s_included_file *inc);
/* From find_one.c */
-int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt),
+int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt),
void *pkt, char *p, dev_t parent_device, int top_level);
int term_find_one(FF_PKT *ff);
int parent_mode, uid_t owner, gid_t group,
int preserve_existing, char *verbose_fmt_string);
+/* from fstype.c */
+bool fstype(const char *fname, char *fs, int fslen);
+
/* from bfile.c -- see bfile.h */
* Bacula GNOME Console interface to the Director
*
* Kern Sibbald, March MMII
- *
+ *
* Version $Id$
*/
/* Imported functions */
int authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
void select_restore_setup();
-
+
/* Exported variables */
GtkWidget *console; /* application window */
GtkWidget *text1; /* text window */
/* Static variables */
static char *configfile = NULL;
-static DIRRES *dir;
+static DIRRES *dir;
static int ndir;
static bool director_reader_running = false;
static bool at_prompt = false;
struct sigaction sigignore;
sigignore.sa_flags = 0;
- sigignore.sa_handler = SIG_IGN;
+ sigignore.sa_handler = SIG_IGN;
sigfillset(&sigignore.sa_mask);
sigaction(SIGPIPE, &sigignore, NULL);
case '?':
default:
usage();
- }
+ }
}
argc -= optind;
argv += optind;
}
UnlockRes();
if (ndir == 0) {
- Emsg1(M_ERROR_TERM, 0, _("No director resource defined in %s\n\
-Without that I don't how to speak to the Director :-(\n"), configfile);
+ Emsg1(M_ERROR_TERM, 0, _("No director resource defined in %s\n"
+"Without that I don't how to speak to the Director :-(\n"), configfile);
}
LockRes();
foreach_res(con_font, R_CONSOLE_FONT) {
if (!con_font->fontface) {
- Dmsg1(400, "No fontface for %s\n", con_font->hdr.name);
+ Dmsg1(400, "No fontface for %s\n", con_font->hdr.name);
continue;
}
text_font = gdk_font_load(con_font->fontface);
if (text_font == NULL) {
- Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n",
+ Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n",
con_font->hdr.name, con_font->fontface);
} else {
- Dmsg2(400, "ConsoleFont \"%s\" (%s) loaded.\n",
+ Dmsg2(400, "ConsoleFont \"%s\" (%s) loaded.\n",
con_font->hdr.name, con_font->fontface);
break;
- }
+ }
}
UnlockRes();
if (text_font == NULL) {
Dmsg1(400, "Attempting to load fallback font %s\n",
- "-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
+ "-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
text_font = gdk_font_load("-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
}
font_desc = pango_font_description_from_string("LucidaTypewriter 9");
options = g_list_append(options, msg);
}
return options;
-
+
}
static GList *get_and_fill_combo(GtkWidget *dialog, const char *combo_name, const char *cm)
combo = lookup_widget(dir_dialog, "combo1");
dir_select = lookup_widget(dir_dialog, "dirselect");
if (dirs) {
- gtk_combo_set_popdown_strings(GTK_COMBO(combo), dirs);
+ gtk_combo_set_popdown_strings(GTK_COMBO(combo), dirs);
}
gtk_widget_show(dir_dialog);
gtk_main();
}
memset(&jcr, 0, sizeof(jcr));
-
+
set_statusf(_(" Connecting to Director %s:%d"), dir->address,dir->DIRport);
set_textf(_("Connecting to Director %s:%d\n\n"), dir->address,dir->DIRport);
while (gtk_events_pending()) { /* fully paint screen */
gtk_main_iteration();
}
- UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
+ UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
NULL, dir->DIRport, 0);
if (UA_sock == NULL) {
return 0;
}
-
+
jcr.dir_bsock = UA_sock;
LockRes();
/* If cons==NULL, default console will be used */
stat = bnet_recv(UA_sock);
if (stat >= 0) {
if (at_prompt) {
- set_text("\n", 1);
+ set_text("\n", 1);
at_prompt = false;
}
set_text(UA_sock->msg, UA_sock->msglen);
ready = false;
}
-void set_status_ready()
+void set_status_ready()
{
gtk_label_set_text(GTK_LABEL(status1), " Ready");
ready = true;
gtk_text_iter_set_offset(&iter, buf_len);
gtk_text_buffer_place_cursor(textbuf, &iter);
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(text1),
- gtk_text_buffer_get_mark(textbuf, "insert"),
+ gtk_text_buffer_get_mark(textbuf, "insert"),
0, TRUE, 0.0, 1.0);
}
POOLMEM *fname; /* name to put into catalog */
POOLMEM *stime; /* start time for incremental/differential */
JOB_DBR jr; /* Job DB record for current job */
- JOB_DBR *verify_jr; /* Pointer to target job */
+ JOB_DBR verify_jr; /* Pointer to target job */
uint32_t RestoreJobId; /* Id specified by UA */
POOLMEM *client_uname; /* client uname */
int replace; /* Replace option */
/* Parmaters for Open Read Session */
BSR *bsr; /* Bootstrap record -- has everything */
+ bool mount_next_volume; /* set to cause next volume mount */
uint32_t read_VolSessionId;
uint32_t read_VolSessionTime;
uint32_t read_StartFile;
#include "bacula.h"
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
static int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultport, int family,
const char *hostname_str, const char *port_str, char **errstr);
{
memcpy(&saddrbuf, &src.saddrbuf, sizeof(saddrbuf));
saddr = &saddrbuf.dontuse;
- saddr4 = &saddrbuf.dontuse4;
+ saddr4 = &saddrbuf.dontuse4;
#ifdef HAVE_IPV6
saddr6 = &saddrbuf.dontuse6;
#endif
}
#endif
saddr = &saddrbuf.dontuse;
- saddr4 = &saddrbuf.dontuse4;
+ saddr4 = &saddrbuf.dontuse4;
#ifdef HAVE_IPV6
saddr6 = &saddrbuf.dontuse6;
#endif
saddr->sa_len = sizeof(sockaddr_in);
#endif
#endif
- set_addr_any();
-}
+ set_addr_any();
+}
void IPADDR::set_type(i_type o)
{
int IPADDR::get_family() const
{
return saddr->sa_family;
-}
+}
struct sockaddr *IPADDR::get_sockaddr()
{
saddr6->sin6_addr = src->saddr6->sin6_addr;
}
#endif
-}
+}
void IPADDR::set_addr_any()
{
}
void IPADDR::set_addr4(struct in_addr *ip4)
-{
+{
if (saddr->sa_family != AF_INET) {
Emsg1(M_ERROR_TERM, 0, _("It was tried to assign a ipv6 address to a ipv4(%d)\n"), saddr->sa_family);
}
#ifdef HAVE_IPV6
void IPADDR::set_addr6(struct in6_addr *ip6)
-{
+{
if (saddr->sa_family != AF_INET6) {
Emsg1(M_ERROR_TERM, 0, _("It was tried to assign a ipv4 address to a ipv6(%d)\n"), saddr->sa_family);
}
const char *IPADDR::get_address(char *outputbuf, int outlen)
{
outputbuf[0] = '\0';
-#if defined(HAVE_INET_NTOP) && defined(HAVE_IPV6)
+#ifdef HAVE_INET_NTOP
+# ifdef HAVE_IPV6
inet_ntop(saddr->sa_family, saddr->sa_family == AF_INET ?
(void*)&(saddr4->sin_addr) : (void*)&(saddr6->sin6_addr),
outputbuf, outlen);
+# else
+ inet_ntop(saddr->sa_family, (void*)&(saddr4->sin_addr), outputbuf, outlen);
+# endif
#else
bstrncpy(outputbuf, inet_ntoa(saddr4->sin_addr), outlen);
#endif
return outputbuf;
}
-const char *IPADDR::build_address_str(char *buf, int blen)
+const char *IPADDR::build_address_str(char *buf, int blen)
{
char tmp[1024];
bsnprintf(buf, blen, "host[%s:%s:%hu] ",
return buf;
}
-const char *build_addresses_str(dlist *addrs, char *buf, int blen)
+const char *build_addresses_str(dlist *addrs, char *buf, int blen)
{
- if (addrs->size() == 0) {
+ if (!addrs || addrs->size() == 0) {
bstrncpy(buf, "", blen);
return buf;
}
int get_first_port_net_order(dlist * addrs)
{
- return ((IPADDR *)(addrs->first()))->get_port_net_order();
+ if (!addrs) {
+ return 0;
+ } else {
+ return ((IPADDR *)(addrs->first()))->get_port_net_order();
+ }
}
int get_first_port_host_order(dlist * addrs)
{
- return ((IPADDR *)(addrs->first()))->get_port_host_order();
+ if (!addrs) {
+ return 0;
+ } else {
+ return ((IPADDR *)(addrs->first()))->get_port_host_order();
+ }
}
void init_default_addresses(dlist **out, int port)
if (addrs->size()) {
addr = (IPADDR *)addrs->first();
} else {
- addr = New(IPADDR(family));
+ addr = New(IPADDR(family));
addr->set_type(type);
addr->set_port_net(defaultport);
addr->set_addr_any();
/* for duplicates */
foreach_dlist(jaddr, addrs) {
if (iaddr->get_sockaddr_len() == jaddr->get_sockaddr_len() &&
- !memcmp(iaddr->get_sockaddr(), jaddr->get_sockaddr(),
+ !memcmp(iaddr->get_sockaddr(), jaddr->get_sockaddr(),
iaddr->get_sockaddr_len()))
{
goto skip; /* no price */
}
}
- clone = New(IPADDR(*iaddr));
+ clone = New(IPADDR(*iaddr));
clone->set_type(type);
clone->set_port_net(port);
addrs->append(clone);
* my tests
* positiv
* = { ip = { addr = 1.2.3.4; port = 1205; } ipv4 = { addr = 1.2.3.4; port = http; } }
- * = { ip = {
- * addr = 1.2.3.4; port = 1205; }
- * ipv4 = {
- * addr = 1.2.3.4; port = http; }
- * ipv6 = {
- * addr = 1.2.3.4;
+ * = { ip = {
+ * addr = 1.2.3.4; port = 1205; }
+ * ipv4 = {
+ * addr = 1.2.3.4; port = http; }
+ * ipv6 = {
+ * addr = 1.2.3.4;
* port = 1205;
- * }
+ * }
* ip = {
* addr = 1.2.3.4
* port = 1205
- * }
+ * }
* ip = {
* addr = 1.2.3.4
- * }
+ * }
* ip = {
* addr = 2001:220:222::2
- * }
+ * }
* ip = {
* addr = bluedot.thun.net
- ( }
+ ( }
* }
* negativ
* = { ip = { } }
}
char *errstr;
- if (pass == 1 && !add_address((dlist **)(item->value), IPADDR::R_MULTIPLE,
+ if (pass == 1 && !add_address((dlist **)(item->value), IPADDR::R_MULTIPLE,
htons(item->default_value), family, hostname_str, port_str, &errstr)) {
scan_err3(lc, _("Can't add hostname(%s) and port(%s) to addrlist (%s)"),
hostname_str, port_str, errstr);
return -1;
}
-int sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
+int sockaddr_get_port(const struct sockaddr *client_addr)
+{
+ if (client_addr->sa_family == AF_INET) {
+ return ntohs(((struct sockaddr_in *)client_addr)->sin_port);
+ }
+#ifdef HAVE_IPV6
+ else {
+ return ntohs(((struct sockaddr_in6 *)client_addr)->sin6_port);
+ }
+#endif
+ return -1;
+}
+
+
+char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len)
{
#ifdef HAVE_INET_NTOP
/* MA Bug 5 the problem was that i mixed up sockaddr and in_addr */
inet_ntop(sa->sa_family,
+# ifdef HAVE_IPV6
sa->sa_family == AF_INET ?
(void*)&(((struct sockaddr_in*)sa)->sin_addr) :
(void*)&(((struct sockaddr_in6*)sa)->sin6_addr),
+# else
+ (void*)&(((struct sockaddr_in*)sa)->sin_addr),
+# endif /* HAVE_IPV6 */
buf, len);
#else
bstrncpy(buf, inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), len);
#endif
- return 1;
+ return buf;
+}
+
+#ifdef HAVE_OLD_SOCKOPT
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ struct in_addr inaddr;
+
+ if((inaddr.s_addr = inet_addr(cp)) != INADDR_NONE) {
+ inp->s_addr = inaddr.s_addr;
+ return 1;
+ }
+ return 0;
}
+#endif
IPADDR(int af);
IPADDR(const IPADDR & src);
private:
- IPADDR() { /* block this construction */ }
+ IPADDR() { /* block this construction */ }
i_type type;
union {
struct sockaddr dontuse;
extern const char *build_addresses_str(dlist *addrs, char *buf, int blen);
extern int sockaddr_get_port_net_order(const struct sockaddr *sa);
-extern int sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+extern int sockaddr_get_port(const struct sockaddr *sa);
+extern char *sockaddr_to_ascii(const struct sockaddr *sa, char *buf, int len);
+#ifdef WIN32
+#undef HAVE_OLD_SOCKOPT
+#endif
+#ifdef HAVE_OLD_SOCKOPT
+extern int inet_aton(const char *cp, struct in_addr *inp);
+#endif
/*
- * Bacula array list routines
+ * Bacula array list routines
*
* alist is a simple malloc'ed array of pointers. For the moment,
- * it simply malloc's a bigger array controlled by num_grow.
+ * it simply malloc's a bigger array controlled by num_grow.
* Default is to realloc the pointer array for each new member.
*
* Kern Sibbald, June MMIII
#include "bacula.h"
/*
- * Private grow list function. Used to insure that
+ * Private grow list function. Used to insure that
* at least one more "slot" is available.
*/
void alist::grow_list()
if (num_items == 0) {
return NULL;
} else {
- cur_item = num_items;
+ cur_item = num_items;
return items[num_items-1];
}
}
}
/*
- * prepend an item to the list
+ * prepend an item to the list -- i.e. add to beginning
*/
void alist::prepend(void *item) {
grow_list();
fileset->mylist.init();
printf("Manual allocation/destruction of list:\n");
-
+
for (int i=0; i<20; i++) {
sprintf(buf, "This is item %d", i);
fileset->mylist.append(bstrdup(buf));
- }
+ }
for (int i=0; i< fileset->mylist.size(); i++) {
- printf("Item %d = %s\n", i, (char *)fileset->mylist[i]);
+ printf("Item %d = %s\n", i, (char *)fileset->mylist[i]);
}
fileset->mylist.destroy();
free(fileset);
for (int i=0; i<20; i++) {
sprintf(buf, "This is item %d", i);
mlist->append(bstrdup(buf));
- }
+ }
for (int i=0; i< mlist->size(); i++) {
- printf("Item %d = %s\n", i, (char *)mlist->get(i));
+ printf("Item %d = %s\n", i, (char *)mlist->get(i));
}
delete mlist;
*/
/*
- Copyright (C) 2003-2004 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
*/
-/*
+/*
* There is a lot of extra casting here to work around the fact
* that some compilers (Sun and Visual C++) do not accept
* (void *) as an lvalue on the left side of an equal.
* Loop var through each member of list
*/
#define foreach_alist(var, list) \
- for((*((void **)&(var))=(void*)((list)->first())); (var); (*((void **)&(var))=(void*)((list)->next())))
+ for((*((void **)&(var))=(void*)((list)->first())); \
+ (var); \
+ (*((void **)&(var))=(void*)((list)->next())))
#ifdef the_easy_way
#define foreach_alist(var, list) \
not_owned_by_alist = false
};
-/*
+/*
* Array list -- much like a simplified STL vector
* array of pointers to inserted items
*/
inline bool alist::empty() const
{
- return num_items == 0;
+ /* Check for null pointer */
+ return this ? num_items == 0 : true;
}
-/*
+/*
* This allows us to do explicit initialization,
* allowing us to mix C++ classes inside malloc'ed
* C structures. Define before called in constructor.
inline alist::~alist() {
destroy();
}
-
+
/* Current size of list */
-inline int alist::size() const
+inline int alist::size() const
{
- return num_items;
+ /*
+ * Check for null pointer, which allows test
+ * on size to succeed even if nothing put in
+ * alist.
+ */
+ return this ? num_items : 0;
}
/* How much to grow by each time */
-inline void alist::grow(int num)
+inline void alist::grow(int num)
{
num_grow = num;
}
*
* by Kern Sibbald
*
- * Adapted and enhanced for Bacula, originally written
+ * Adapted and enhanced for Bacula, originally written
* for inclusion in the Apcupsd package
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
#define socketClose(fd) close(fd)
#endif
+static pthread_mutex_t ip_mutex = PTHREAD_MUTEX_INITIALIZER;
/*
* Read a nbytes from the network.
return nbytes - nleft;
}
-/*
+/*
* Receive a message from the other end. Each message consists of
* two packets. The first is a header that contains the size
* of the data that follows in the second packet.
* Returns number of bytes read (may return zero)
- * Returns -1 on signal (BNET_SIGNAL)
+ * Returns -1 on signal (BNET_SIGNAL)
* Returns -2 on hard end of file (BNET_HARDEOF)
* Returns -3 on error (BNET_ERROR)
*
* four return types:
* 1. Normal data
* 2. Signal including end of data stream
- * 3. Hard end of file
+ * 3. Hard end of file
* 4. Error
* Using is_bnet_stop() and is_bnet_error() you can figure this all out.
*/
/*
- * Return 1 if there are errors on this bsock or it is closed,
+ * Return 1 if there are errors on this bsock or it is closed,
* i.e. stop communicating on this line.
*/
bool is_bnet_stop(BSOCK * bsock)
}
/*
- * Return number of errors on socket
+ * Return number of errors on socket
*/
int is_bnet_error(BSOCK * bsock)
{
+ errno = bsock->b_errno;
return bsock->errors;
}
if (rc < 0) {
if (!bsock->suppress_error_msgs && !bsock->timed_out) {
Qmsg4(bsock->jcr, M_ERROR, 0,
- _("Write error sending to %s:%s:%d: ERR=%s\n"), bsock->who,
+ _("Write error sending len to %s:%s:%d: ERR=%s\n"), bsock->who,
bsock->host, bsock->port, bnet_strerror(bsock));
}
} else {
}
if (rc < 0) {
if (!bsock->suppress_error_msgs) {
- Qmsg4(bsock->jcr, M_ERROR, 0,
- _("Write error sending to %s:%s:%d: ERR=%s\n"), bsock->who,
+ Qmsg5(bsock->jcr, M_ERROR, 0,
+ _("Write error sending %d bytes to %s:%s:%d: ERR=%s\n"),
+ bsock->msglen, bsock->who,
bsock->host, bsock->port, bnet_strerror(bsock));
}
} else {
}
/*
- * Establish an SSL connection -- server side
+ * Establish an SSL connection -- server side
* Codes that ssl_need and ssl_has can take
* BNET_SSL_NONE I cannot do ssl
* BNET_SSL_OK I can do ssl, but it is not required on my end
}
/*
- * Establish an SSL connection -- client side
+ * Establish an SSL connection -- client side
*/
int bnet_ssl_client(BSOCK * bsock, char *password, int ssl_need)
{
}
-static pthread_mutex_t ip_mutex = PTHREAD_MUTEX_INITIALIZER;
static IPADDR *add_any(int family)
return addr_list;
}
-/*
+/*
* Open a TCP connection to the UPS network server
* Returns NULL
* Returns BSOCK * pointer on success
const char *errstr;
int save_errno = 0;
- /*
+ /*
* Fill in the structure serv_addr with the address of
* the server that we want to connect with.
*/
ipaddr->set_port_net(htons(port));
char allbuf[256 * 10];
char curbuf[256];
- Dmsg2(100, "Current %sAll %s\n",
- ipaddr->build_address_str(curbuf, sizeof(curbuf)),
+ Dmsg2(100, "Current %sAll %s\n",
+ ipaddr->build_address_str(curbuf, sizeof(curbuf)),
build_addresses_str(addr_list, allbuf, sizeof(allbuf)));
/* Open a TCP socket */
if ((sockfd = socket(ipaddr->get_family(), SOCK_STREAM, 0)) < 0) {
berrno be;
save_errno = errno;
*fatal = 1;
- Pmsg3(000, "Socket open error. proto=%d port=%d. ERR=%s\n",
+ Pmsg3(000, "Socket open error. proto=%d port=%d. ERR=%s\n",
ipaddr->get_family(), ipaddr->get_port_host_order(), be.strerror());
continue;
}
if (i < 0) {
i = 60 * 5; /* complain again in 5 minutes */
if (verbose)
- Qmsg4(jcr, M_WARNING, 0, "Could not connect to %s on %s:%d. ERR=%s\n\
-Retrying ...\n", name, host, port, be.strerror());
+ Qmsg4(jcr, M_WARNING, 0, "Could not connect to %s on %s:%d. ERR=%s\n"
+"Retrying ...\n", name, host, port, be.strerror());
}
bmicrosleep(retry_interval, 0);
max_retry_time -= retry_interval;
return bnet_send(bs);
}
-/*
+/*
* Set the network buffer size, suggested size is in size.
* Actual size obtained is returned in bs->msglen
*
return false;
}
if (rw & BNET_SETBUF_READ) {
- while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
+ while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
SO_RCVBUF, (sockopt_val_t) & dbuf_size, sizeof(dbuf_size)) < 0)) {
berrno be;
Qmsg1(bs->jcr, M_ERROR, 0, _("sockopt error: %s\n"), be.strerror());
}
start_size = dbuf_size;
if (rw & BNET_SETBUF_WRITE) {
- while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
+ while ((dbuf_size > TAPE_BSIZE) && (setsockopt(bs->fd, SOL_SOCKET,
SO_SNDBUF, (sockopt_val_t) & dbuf_size, sizeof(dbuf_size)) < 0)) {
berrno be;
Qmsg1(bs->jcr, M_ERROR, 0, _("sockopt error: %s\n"), be.strerror());
}
/*
- * Send a network "signal" to the other end
+ * Send a network "signal" to the other end
* This consists of sending a negative packet length
*
* Returns: false on failure
case BNET_PROMPT:
return "BNET_PROMPT";
default:
- sprintf(buf, "Unknown sig %d", bs->msglen);
+ sprintf(buf, "Unknown sig %d", (int)bs->msglen);
return buf;
}
}
-/* Initialize internal socket structure.
+/* Initialize internal socket structure.
* This probably should be done in net_open
*/
BSOCK *init_bsock(JCR * jcr, int sockfd, const char *who, const char *host, int port,
bsock->port = port;
memcpy(&bsock->client_addr, client_addr, sizeof(bsock->client_addr));
/*
- * ****FIXME**** reduce this to a few hours once
+ * ****FIXME**** reduce this to a few hours once
* heartbeats are implemented
*/
bsock->timeout = 60 * 60 * 6 * 24; /* 6 days timeout */
MA 02111-1307, USA.
*/
- /*
+ /*
* Originally written by Kern Sibbald for inclusion in apcupsd,
* but heavily modified for Bacula
*
*/
#include "bacula.h"
-#undef DEV_BSIZE
#include <netinet/in.h>
#include <sys/socket.h>
#include <stdlib.h>
}
}
-/*
- Become Threaded Network Server
+/*
+ Become Threaded Network Server
This function is able to handle multiple server ips in
ipv4 and ipv6 style. The Addresse are give in a comma
seperated string in bind_addr
fd_ptr = (s_sockfd *)alloca(sizeof(s_sockfd));
fd_ptr->port = p->get_port_net_order();
/*
- * Open a TCP socket
+ * Open a TCP socket
*/
for (tlog= 60; (fd_ptr->fd=socket(p->get_family(), SOCK_STREAM, 0)) < 0; tlog -= 10) {
if (tlog <= 0) {
char curbuf[256];
Emsg3(M_ABORT, 0, _("Cannot open stream socket. ERR=%s. Current %s All %s\n"),
be.strerror(),
- p->build_address_str(curbuf, sizeof(curbuf)),
+ p->build_address_str(curbuf, sizeof(curbuf)),
build_addresses_str(addrs, allbuf, sizeof(allbuf)));
}
bmicrosleep(10, 0);
}
/*
- * Reuse old sockets
+ * Reuse old sockets
*/
if (setsockopt(fd_ptr->fd, SOL_SOCKET, SO_REUSEADDR, (sockopt_val_t)&turnon,
sizeof(turnon)) < 0) {
be.set_errno(stat);
Emsg1(M_ABORT, 0, _("Could not init client queue: ERR=%s\n"), be.strerror());
}
- /*
+ /*
* Wait for a connection from the client process.
*/
for (; !quit;) {
fromhost(&request);
if (!hosts_access(&request)) {
V(mutex);
-#ifndef HAVE_INET_NTOP
Jmsg2(NULL, M_SECURITY, 0,
_("Connection from %s:%d refused by hosts.access\n"),
- inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr),
- ntohs(((sockaddr_in *)&cli_addr)->sin_port));
-#else
- Jmsg2(NULL, M_SECURITY, 0,
- _("Connection from %s:%d refused by hosts.access\n"),
- inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6,
- &clilen, buf, clilen),
- ntohs(clilen == sizeof(sockaddr_in) ?
- ((sockaddr_in *)&cli_addr)->sin_port :
- ((sockaddr_in6 *)&cli_addr)->sin6_port));
-#endif
+ sockaddr_to_ascii(&cli_addr, buf, sizeof(buf)),
+ sockaddr_get_port(&cli_addr));
close(newsockfd);
continue;
}
/* see who client is. i.e. who connected to us. */
P(mutex);
-#ifdef HAVE_INET_NTOP
- inet_ntop(clilen == sizeof(sockaddr_in) ? AF_INET : AF_INET6, &clilen,
- buf, sizeof(buf));
-#else
- bstrncpy(buf, inet_ntoa(((sockaddr_in *)&cli_addr)->sin_addr), sizeof(buf)); /* NOT thread safe, use mutex */
-#endif
+ sockaddr_to_ascii(&cli_addr, buf, sizeof(buf));
V(mutex);
- BSOCK *bs;
+ BSOCK *bs;
bs = init_bsock(NULL, newsockfd, "client", buf, fd_ptr->port, &cli_addr);
if (bs == NULL) {
Jmsg0(NULL, M_ABORT, 0, _("Could not create client BSOCK.\n"));
int turnon = 1;
/*
- * Open a TCP socket
+ * Open a TCP socket
*/
for (tlog = 0; (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0; tlog -= 10) {
if (errno == EINTR || errno == EAGAIN) {
}
/*
- * Reuse old sockets
+ * Reuse old sockets
*/
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (sockopt_val_t)&turnon, sizeof(turnon)) < 0) {
Emsg1(M_WARNING, 0, _("Cannot set SO_REUSEADDR on socket: %s\n"),
strerror(errno));
}
- /*
+ /*
* Bind our local address so that the client can send to us.
*/
bzero((char *)&serv_addr, sizeof(serv_addr));
}
/*
- * Accept a single connection
+ * Accept a single connection
*/
BSOCK *bnet_accept(BSOCK * bsock, char *who)
{
struct request_info request;
#endif
- /*
+ /*
* Wait for a connection from the client process.
*/
FD_ZERO(&sockset);
FD_SET((unsigned)bsock->fd, &sockset);
for (;;) {
- /*
+ /*
* Wait for a connection from a client process.
*/
ready = sockset;
/*
* bpipe.c bi-directional pipe
- *
+ *
* Kern Sibbald, November MMII
*
* Version $Id$
#include "bacula.h"
#include "jcr.h"
-int execvp_errors[] = {EACCES, ENOEXEC, EFAULT, EINTR, E2BIG,
+int execvp_errors[] = {EACCES, ENOEXEC, EFAULT, EINTR, E2BIG,
ENAMETOOLONG, ENOMEM, ETXTBSY, ENOENT};
int num_execvp_errors = (int)(sizeof(execvp_errors)/sizeof(int));
* Run an external program. Optionally wait a specified number
* of seconds. Program killed if wait exceeded. We open
* a bi-directional pipe so that the user can read from and
- * write to the program.
+ * write to the program.
*/
BPIPE *open_bpipe(char *prog, int wait, const char *mode)
{
return stat;
}
-/*
- * Close both pipes and free resources
+/*
+ * Close both pipes and free resources
*
* Returns: 0 on success
* berrno on failure
*/
-int close_bpipe(BPIPE *bpipe)
+int close_bpipe(BPIPE *bpipe)
{
int chldstatus = 0;
- int stat = 0;
+ int stat = 0;
int wait_option;
int remaining_wait;
pid_t wpid = 0;
/* wait for worker child to exit */
for ( ;; ) {
- Dmsg2(200, "Wait for %d opt=%d\n", bpipe->worker_pid, wait_option);
+ Dmsg2(800, "Wait for %d opt=%d\n", bpipe->worker_pid, wait_option);
do {
wpid = waitpid(bpipe->worker_pid, &chldstatus, wait_option);
} while (wpid == -1 && (errno == EINTR || errno == EAGAIN));
if (wpid == bpipe->worker_pid || wpid == -1) {
stat = errno;
- Dmsg3(200, "Got break wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+ Dmsg3(800, "Got break wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
wpid==-1?strerror(errno):"none");
break;
}
- Dmsg3(200, "Got wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+ Dmsg3(800, "Got wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
wpid==-1?strerror(errno):"none");
if (remaining_wait > 0) {
bmicrosleep(1, 0); /* wait one second */
if (WIFEXITED(chldstatus)) { /* process exit()ed */
stat = WEXITSTATUS(chldstatus);
if (stat != 0) {
- Dmsg1(200, "Non-zero status %d returned from child.\n", stat);
+ Dmsg1(800, "Non-zero status %d returned from child.\n", stat);
stat |= b_errno_exit; /* exit status returned */
}
- Dmsg1(200, "child status=%d\n", stat & ~b_errno_exit);
+ Dmsg1(800, "child status=%d\n", stat & ~b_errno_exit);
} else if (WIFSIGNALED(chldstatus)) { /* process died */
stat = WTERMSIG(chldstatus);
- Dmsg1(200, "Child died from signale %d\n", stat);
+ Dmsg1(800, "Child died from signale %d\n", stat);
stat |= b_errno_signal; /* exit signal returned */
}
- }
+ }
if (bpipe->timer_id) {
stop_child_timer(bpipe->timer_id);
}
free(bpipe);
- Dmsg1(200, "returning stat = %d\n", stat);
+ Dmsg1(800, "returning stat = %d\n", stat);
return stat;
}
* of seconds. Program killed if wait exceeded. Optionally
* return the output from the program (normally a single line).
*
- * Contrary to my normal calling conventions, this program
+ * Contrary to my normal calling conventions, this program
*
* Returns: 0 on success
* non-zero on error == berrno status
}
if (results) {
results[0] = 0;
- fgets(results, sizeof_pool_memory(results), bpipe->rfd);
+ fgets(results, sizeof_pool_memory(results), bpipe->rfd);
if (feof(bpipe->rfd)) {
stat1 = 0;
} else {
return stat1;
}
+/*
+ * Run an external program. Optionally wait a specified number
+ * of seconds. Program killed if wait exceeded (it is done by the
+ * watchdog, as fgets is a blocking function).
+ * Return the full output from the program (not only the first line).
+ *
+ * Contrary to my normal calling conventions, this program
+ *
+ * Returns: 0 on success
+ * non-zero on error == berrno status
+ *
+ */
+int run_program_full_output(char *prog, int wait, POOLMEM *results)
+{
+ BPIPE *bpipe;
+ int stat1, stat2;
+ char *mode;
+ POOLMEM* tmp;
+
+ if (results == NULL) {
+ return run_program(prog, wait, NULL);
+ }
+
+ tmp = get_pool_memory(PM_MESSAGE);
+
+ mode = (char *)"r";
+ bpipe = open_bpipe(prog, wait, mode);
+ if (!bpipe) {
+ return ENOENT;
+ }
+
+ results[0] = 0;
+
+ while (1) {
+ fgets(tmp, sizeof_pool_memory(tmp), bpipe->rfd);
+ Dmsg1(800, "Run program fgets=%s", tmp);
+ pm_strcat(results, tmp);
+ if (feof(bpipe->rfd)) {
+ stat1 = 0;
+ Dmsg1(100, "Run program fgets stat=%d\n", stat1);
+ break;
+ } else {
+ stat1 = ferror(bpipe->rfd);
+ }
+ if (stat1 < 0) {
+ Dmsg2(100, "Run program fgets stat=%d ERR=%s\n", stat1, strerror(errno));
+ break;
+ } else if (stat1 != 0) {
+ Dmsg1(100, "Run program fgets stat=%d\n", stat1);
+ }
+ }
+
+ stat2 = close_bpipe(bpipe);
+ stat1 = stat2 != 0 ? stat2 : stat1;
+
+ Dmsg1(100, "Run program returning %d\n", stat);
+ free_pool_memory(tmp);
+ return stat1;
+}
/*
* Build argc and argv from a string
*/
static void build_argc_argv(char *cmd, int *bargc, char *bargv[], int max_argv)
{
- int i;
+ int i;
char *p, *q, quote;
int argc = 0;
/*
* Miscellaneous Bacula memory and thread safe routines
* Generally, these are interfaces to system or standard
- * library routines.
- *
+ * library routines.
+ *
* Bacula utility functions are in util.c
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include <grp.h>
#endif
+static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
+
+/*
+ * This routine will sleep (sec, microsec). Note, however, that if a
+ * signal occurs, it will return early. It is up to the caller
+ * to recall this routine if he/she REALLY wants to sleep the
+ * requested time.
+ */
+int bmicrosleep(time_t sec, long usec)
+{
+ struct timespec timeout;
+ struct timeval tv;
+ struct timezone tz;
+ int stat;
+
+ timeout.tv_sec = sec;
+ timeout.tv_nsec = usec * 1000;
+
+#ifdef HAVE_NANOSLEEP
+ stat = nanosleep(&timeout, NULL);
+ if (!(stat < 0 && errno == ENOSYS)) {
+ return stat;
+ }
+ /* If we reach here it is because nanosleep is not supported by the OS */
+#endif
+
+ /* Do it the old way */
+ gettimeofday(&tv, &tz);
+ timeout.tv_nsec += tv.tv_usec * 1000;
+ timeout.tv_sec += tv.tv_sec;
+ while (timeout.tv_nsec >= 1000000000) {
+ timeout.tv_nsec -= 1000000000;
+ timeout.tv_sec++;
+ }
+
+ Dmsg2(200, "pthread_cond_timedwait sec=%d usec=%d\n", sec, usec);
+ /* Note, this unlocks mutex during the sleep */
+ P(timer_mutex);
+ stat = pthread_cond_timedwait(&timer, &timer_mutex, &timeout);
+ if (stat != 0) {
+ berrno be;
+ Dmsg2(200, "pthread_cond_timedwait stat=%d ERR=%s\n", stat,
+ be.strerror(stat));
+ }
+ V(timer_mutex);
+ return stat;
+}
+
/*
* Guarantee that the string is properly terminated */
char *bstrncpy(char *dest, const char *src, int maxlen)
/*
* Implement snprintf
*/
-int bsnprintf(char *str, int32_t size, const char *fmt, ...)
+int bsnprintf(char *str, int32_t size, const char *fmt, ...)
{
va_list arg_ptr;
int len;
#else
- int len;
+ int len, buflen;
char *buf;
- buf = get_memory(BIG_BUF);
+ buflen = size > BIG_BUF ? size : BIG_BUF;
+ buf = get_memory(buflen);
len = vsprintf(buf, format, ap);
- if (len >= BIG_BUF) {
+ if (len >= buflen) {
Emsg0(M_ABORT, 0, _("Buffer overflow.\n"));
}
- memcpy(str, buf, size);
- str[size-1] = 0;
+ memcpy(str, buf, len);
+ str[len] = 0; /* len excludes the null */
free_memory(buf);
return len;
#endif
{
static pthread_mutex_t mutex;
static bool first = true;
- struct tm *ltm,
+ struct tm *ltm,
if (first) {
pthread_mutex_init(&mutex, NULL);
} else {
e_msg(file, line, M_ERROR, 0, _("Possible mutex deadlock resolved.\n"));
}
-
+
}
}
if (stat(fname, &statp) == 0) {
/* File exists, see what we have */
*pidbuf = 0;
- if ((pidfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0 ||
+ if ((pidfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0 ||
read(pidfd, &pidbuf, sizeof(pidbuf)) < 0 ||
sscanf(pidbuf, "%d", &oldpid) != 1) {
Emsg2(M_ERROR_TERM, 0, _("Cannot open pid file. %s ERR=%s\n"), fname, strerror(errno));
uint64_t reserved[20];
};
-static struct s_state_hdr state_hdr = {
+static struct s_state_hdr state_hdr = {
"Bacula State\n",
3,
0
/* If file exists, see what we have */
// Dmsg1(10, "O_BINARY=%d\n", O_BINARY);
if ((sfd = open(fname, O_RDONLY|O_BINARY, 0)) < 0) {
- Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n",
+ Dmsg3(010, "Could not open state file. sfd=%d size=%d: ERR=%s\n",
sfd, sizeof(hdr), strerror(errno));
goto bail_out;
}
if ((stat=read(sfd, &hdr, hdr_size)) != hdr_size) {
- Dmsg4(010, "Could not read state file. sfd=%d stat=%d size=%d: ERR=%s\n",
+ Dmsg4(010, "Could not read state file. sfd=%d stat=%d size=%d: ERR=%s\n",
sfd, (int)stat, hdr_size, strerror(errno));
goto bail_out;
}
if (hdr.version != state_hdr.version) {
- Dmsg2(010, "Bad hdr version. Wanted %d got %d\n",
+ Dmsg2(010, "Bad hdr version. Wanted %d got %d\n",
state_hdr.version, hdr.version);
}
hdr.id[13] = 0;
}
// Dmsg1(010, "Wrote header of %d bytes\n", sizeof(state_hdr));
state_hdr.last_jobs_addr = sizeof(state_hdr);
- state_hdr.reserved[0] = write_last_jobs_list(sfd, state_hdr.last_jobs_addr);
+ state_hdr.reserved[0] = write_last_jobs_list(sfd, state_hdr.last_jobs_addr);
// Dmsg1(010, "write last job end = %d\n", (int)state_hdr.reserved[0]);
if (lseek(sfd, 0, SEEK_SET) < 0) {
Dmsg1(000, "lseek error: ERR=%s\n", strerror(errno));
goto bail_out;
- }
+ }
if (write(sfd, &state_hdr, sizeof(state_hdr)) != sizeof(state_hdr)) {
Pmsg1(000, "Write final hdr error: ERR=%s\n", strerror(errno));
}
}
}
#endif
-
-}
-
-static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t timer = PTHREAD_COND_INITIALIZER;
-
-/*
- * This routine will sleep (sec, microsec). Note, however, that if a
- * signal occurs, it will return early. It is up to the caller
- * to recall this routine if he/she REALLY wants to sleep the
- * requested time.
- */
-int bmicrosleep(time_t sec, long usec)
-{
- struct timespec timeout;
- struct timeval tv;
- struct timezone tz;
- int stat;
-
- timeout.tv_sec = sec;
- timeout.tv_nsec = usec * 1000;
-
-#ifdef HAVE_NANOSLEEP
- stat = nanosleep(&timeout, NULL);
- if (!(stat < 0 && errno == ENOSYS)) {
- return stat;
- }
- /* If we reach here it is because nanosleep is not supported by the OS */
-#endif
- /* Do it the old way */
- gettimeofday(&tv, &tz);
- timeout.tv_nsec += tv.tv_usec * 1000;
- timeout.tv_sec += tv.tv_sec;
- while (timeout.tv_nsec >= 1000000000) {
- timeout.tv_nsec -= 1000000000;
- timeout.tv_sec++;
- }
-
- Dmsg2(200, "pthread_cond_timedwait sec=%d usec=%d\n", sec, usec);
- /* Note, this unlocks mutex during the sleep */
- P(timer_mutex);
- stat = pthread_cond_timedwait(&timer, &timer_mutex, &timeout);
- if (stat != 0) {
- berrno be;
- Dmsg2(200, "pthread_cond_timedwait stat=%d ERR=%s\n", stat,
- be.strerror(stat));
- }
- V(timer_mutex);
- return stat;
}
+
/* BSDI does not have this. This is a *poor* simulation */
#ifndef HAVE_STRTOLL
long long int
strtoll(const char *ptr, char **endptr, int base)
{
- return (long long int)strtod(ptr, endptr);
+ return (long long int)strtod(ptr, endptr);
}
#endif
char *bfgets(char *s, int size, FILE *fd)
{
char *p = s;
- int ch;
+ int ch;
*p = 0;
for (int i=0; i < size-1; i++) {
do {
ungetc(ch, fd); /* Push next character back to fd */
}
break;
- }
+ }
if (ch == '\n') {
break;
}
* in the UNIX Environment"
*
* Initialize a daemon process completely detaching us from
- * any terminal processes.
+ * any terminal processes.
*
- */
+ */
/*
Copyright (C) 2000-2004 Kern Sibbald and John Walker
#include "bacula.h"
extern int debug_level;
-void
+void
daemon_start()
{
#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
* Become a daemon.
*/
- Dmsg0(200, "Enter daemon_start\n");
+ Dmsg0(900, "Enter daemon_start\n");
if ( (cpid = fork() ) < 0)
Emsg1(M_ABORT, 0, "Cannot fork to become daemon: %s\n", strerror(errno));
else if (cpid > 0)
exit(0); /* parent exits */
/* Child continues */
-
+
setsid();
/* In the PRODUCTION system, we close ALL
chdir("/");
#endif
- /*
+ /*
* Avoid creating files 666 but don't override any
* more restrictive mask set by the user.
*/
}
#endif /* HAVE_CYGWIN */
- Dmsg0(200, "Exit daemon_start\n");
+ Dmsg0(900, "Exit daemon_start\n");
}
/*
- * edit.c edit string to ascii, and ascii to internal
- *
+ * edit.c edit string to ascii, and ascii to internal
+ *
* Kern Sibbald, December MMII
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include <math.h>
/* We assume ASCII input and don't worry about overflow */
-uint64_t str_to_uint64(char *str)
+uint64_t str_to_uint64(char *str)
{
register char *p = str;
register uint64_t value = 0;
return value;
}
-int64_t str_to_int64(char *str)
+int64_t str_to_int64(char *str)
{
register char *p = str;
register int64_t value;
*/
char *edit_uint64_with_commas(uint64_t val, char *buf)
{
- /*
+ /*
* Replacement for sprintf(buf, "%" llu, val)
*/
char mbuf[50];
*/
char *edit_uint64(uint64_t val, char *buf)
{
- /*
+ /*
+ * Replacement for sprintf(buf, "%" llu, val)
+ */
+ char mbuf[50];
+ mbuf[sizeof(mbuf)-1] = 0;
+ int i = sizeof(mbuf)-2; /* edit backward */
+ if (val == 0) {
+ mbuf[i--] = '0';
+ } else {
+ while (val != 0) {
+ mbuf[i--] = "0123456789"[val%10];
+ val /= 10;
+ }
+ }
+ strcpy(buf, &mbuf[i+1]);
+ return buf;
+}
+
+char *edit_int64(int64_t val, char *buf)
+{
+ /*
* Replacement for sprintf(buf, "%" llu, val)
*/
char mbuf[50];
+ bool negative = false;
mbuf[sizeof(mbuf)-1] = 0;
int i = sizeof(mbuf)-2; /* edit backward */
if (val == 0) {
mbuf[i--] = '0';
} else {
+ if (val < 0) {
+ negative = true;
+ val = -val;
+ }
while (val != 0) {
mbuf[i--] = "0123456789"[val%10];
val /= 10;
}
}
+ if (negative) {
+ mbuf[i--] = '-';
+ }
strcpy(buf, &mbuf[i+1]);
return buf;
}
+
/*
* Given a string "str", separate the integer part into
* str, and the modifier into mod.
static bool get_modifier(char *str, char *num, int num_len, char *mod, int mod_len)
{
int i, len, num_begin, num_end, mod_begin, mod_end;
-
+
/*
* Look for modifier by walking back looking for the first
* space or digit.
char num_str[50];
/*
* The "n" = mins and months appears before minutes so that m maps
- * to months. These "kludges" make it compatible with pre 1.31
+ * to months. These "kludges" make it compatible with pre 1.31
* Baculas.
*/
- static const char *mod[] = {"n", "seconds", "months", "minutes",
+ static const char *mod[] = {"n", "seconds", "months", "minutes",
"hours", "days", "weeks", "quarters", "years", NULL};
- static const int32_t mult[] = {60, 1, 60*60*24*30, 60,
+ static const int32_t mult[] = {60, 1, 60*60*24*30, 60,
60*60, 60*60*24, 60*60*24*7, 60*60*24*91, 60*60*24*365};
while (*str) {
bstrncat(buf, mybuf, buf_len);
}
}
- if (val == 0 && strlen(buf) == 0) {
+ if (val == 0 && strlen(buf) == 0) {
bstrncat(buf, "0 secs", buf_len);
} else if (val != 0) {
bsnprintf(mybuf, sizeof(mybuf), "%d sec%s", (uint32_t)val, val>1?"s":"");
}
/*
- * Check if the specified string is an integer
+ * Check if the specified string is an integer
*/
bool is_an_integer(const char *n)
{
/*
* Check if Bacula Resoure Name is valid
*/
-/*
+/*
* Check if the Volume name has legal characters
* If ua is non-NULL send the message
*/
/*
* Add commas to a string, which is presumably
- * a number.
+ * a number.
*/
char *add_commas(char *val, char *buf)
{
*q-- = *p--;
}
*q-- = ',';
- }
+ }
return buf;
}
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bacula.h"
-
-#ifndef HAVE_FNMATCH
-
-/* Enable GNU extensions in fnmatch.h. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
#include "fnmatch.h"
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
-
-#endif /* !HAVE_FNMATCH */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef _FNMATCH_H
+#ifndef _FNMATCH_H
-#define _FNMATCH_H 1
+#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
-#define __P(protos) protos
+#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
-#define __P(protos) ()
+#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
-#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
-#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
-#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
-
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
-#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
-#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
-#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
-#endif
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+
+/* #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) */
+#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+/* #endif -- kes 12Jan05 */
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
-#define FNM_NOMATCH 1
+#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
* the randomness. In this program, the hash table can grow when
* it gets too full, so the table size here is a binary number. The
* hashing is provided using an idea from Tcl where the initial
- * hash code is then "randomized" using a simple calculation from
+ * hash code is "randomized" using a simple calculation from
* a random number generator that multiplies by a big number
* (I multiply by a prime number, while Tcl did not)
- * then shifts the results down and does the binary division
+ * then shifts the result down and does the binary division
* by masking. Increasing the size of the hash table is simple.
* Just create a new larger table, walk the old table and
* re-hash insert each entry into the new table.
*
- *
+ *
* Kern Sibbald, July MMIII
*
* Version $Id$
*
*/
/*
- Copyright (C) 2003-2004 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
walk_index = 0;
}
-#ifdef xxx
-void * htable::operator new(size_t)
-{
- return malloc(sizeof(htable));
-}
-
-void htable::operator delete(void *tbl)
-{
- ((htable *)tbl)->destroy();
- free(tbl);
-}
-#endif
-
uint32_t htable::size()
{
return num_items;
}
-void htable::stats()
+/*
+ * Take each hash link and walk down the chain of items
+ * that hash there counting them (i.e. the hits),
+ * then report that number.
+ * Obiously, the more hits in a chain, the more time
+ * it takes to reference them. Empty chains are not so
+ * hot either -- as it means unused or wasted space.
+ */
+#define MAX_COUNT 20
+void htable::stats()
{
- int count[10];
+ int hits[MAX_COUNT];
int max = 0;
int i, j;
hlink *p;
- printf("\n\nNumItems=%d\nBuckets=%d\n", num_items, buckets);
- for (i=0; i<10; i++) {
- count[i] = 0;
+ printf("\n\nNumItems=%d\nTotal buckets=%d\n", num_items, buckets);
+ printf("Hits/bucket: buckets\n");
+ for (i=0; i < MAX_COUNT; i++) {
+ hits[i] = 0;
}
for (i=0; i<(int)buckets; i++) {
p = table[i];
- j = 0;
+ j = 0;
while (p) {
p = (hlink *)(p->next);
j++;
if (j > max) {
max = j;
}
- if (j < 10) {
- count[j]++;
+ if (j < MAX_COUNT) {
+ hits[j]++;
}
}
- for (i=0; i<10; i++) {
- printf("%2d: %d\n",i, count[i]);
+ for (i=0; i < MAX_COUNT; i++) {
+ printf("%2d: %d\n",i, hits[i]);
}
- printf("max = %d\n", max);
+ printf("max hits in a bucket = %d\n", max);
}
void htable::grow_table()
big->walk_index = 0;
/* Insert all the items in the new hash table */
Dmsg1(100, "Before copy num_items=%d\n", num_items);
- /*
+ /*
* We walk through the old smaller tree getting items,
* but since we are overwriting the colision links, we must
* explicitly save the item->next pointer and walk each
if (ni) {
item = (void *)((char *)ni-loffset);
} else {
- walkptr = NULL;
+ walkptr = NULL;
item = next();
}
}
}
}
if (walkptr) {
- Dmsg2(100, "next: rtn 0x%x walk_index=%d\n",
+ Dmsg2(100, "next: rtn 0x%x walk_index=%d\n",
(unsigned)(((char *)walkptr)-loffset), walk_index);
return ((char *)walkptr)-loffset;
- }
+ }
Dmsg0(100, "next: return NULL\n");
return NULL;
}
if (walkptr) {
Dmsg1(100, "Leave first walkptr=0x%x\n", (unsigned)walkptr);
return ((char *)walkptr)-loffset;
- }
+ }
Dmsg0(100, "Leave first walkptr=NULL\n");
return NULL;
}
MYJCR *save_jcr = NULL, *item;
MYJCR *jcr = NULL;
int count = 0;
-
+
jcrtbl = (htable *)malloc(sizeof(htable));
jcrtbl->init(jcr, &jcr->link, NITEMS);
-
+
Dmsg1(000, "Inserting %d items\n", NITEMS);
for (int i=0; i<NITEMS; i++) {
sprintf(mkey, "This is htable item %d", i);
*/
/*
- Copyright (C) 2000-2003 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
*/
/* ========================================================================
- *
+ *
* Hash table class -- htable
*
*/
* Loop var through each member of table
*/
#define foreach_htable(var, tbl) \
- for(((void *)(var))=(tbl)->first(); \
+ for((*((void **)&(var))=(void *)((tbl)->first())); \
(var); \
- ((void *)(var))=(tbl)->next())
+ (*((void **)&(var))=(void *)((tbl)->next())))
struct hlink {
void *next; /* next hash item */
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
dlist *last_jobs = NULL;
const int max_last_jobs = 10;
-static JCR *jobs = NULL; /* pointer to JCR chain */
+JCR *jobs = NULL; /* pointer to JCR chain */
static brwlock_t lock; /* lock for last jobs and JCR chain */
void init_last_jobs_list()
if (!last_jobs) {
last_jobs = New(dlist(job_entry, &job_entry->link));
if ((errstat=rwl_init(&lock)) != 0) {
- Emsg1(M_ABORT, 0, _("Unable to initialize jcr_chain lock. ERR=%s\n"),
+ Emsg1(M_ABORT, 0, _("Unable to initialize jcr_chain lock. ERR=%s\n"),
strerror(errstat));
}
}
{
if (last_jobs) {
while (!last_jobs->empty()) {
- void *je = last_jobs->first();
+ void *je = last_jobs->first();
last_jobs->remove(je);
- free(je);
+ free(je);
}
delete last_jobs;
last_jobs = NULL;
stat = 0;
}
return stat;
-
+
}
-void lock_last_jobs_list()
+void lock_last_jobs_list()
{
/* Use jcr chain mutex */
lock_jcr_chain();
}
-void unlock_last_jobs_list()
+void unlock_last_jobs_list()
{
/* Use jcr chain mutex */
unlock_jcr_chain();
MQUEUE_ITEM *item = NULL;
struct sigaction sigtimer;
- Dmsg0(400, "Enter new_jcr\n");
+ Dmsg0(3400, "Enter new_jcr\n");
jcr = (JCR *)malloc(size);
memset(jcr, 0, size);
jcr->my_thread_id = pthread_self();
*/
static void remove_jcr(JCR *jcr)
{
- Dmsg0(400, "Enter remove_jcr\n");
+ Dmsg0(3400, "Enter remove_jcr\n");
if (!jcr) {
Emsg0(M_ABORT, 0, "NULL jcr.\n");
}
if (jcr->next) {
jcr->next->prev = jcr->prev;
}
- Dmsg0(400, "Leave remove_jcr\n");
+ Dmsg0(3400, "Leave remove_jcr\n");
}
/*
* Free stuff common to all JCRs. N.B. Be careful to include only
- * generic stuff in the common part of the jcr.
+ * generic stuff in the common part of the jcr.
*/
static void free_common_jcr(JCR *jcr)
{
free(jcr);
}
-/*
+/*
* Global routine to free a jcr
*/
#ifdef DEBUG
void b_free_jcr(const char *file, int line, JCR *jcr)
{
- Dmsg3(400, "Enter free_jcr 0x%x from %s:%d\n", jcr, file, line);
+ Dmsg3(3400, "Enter free_jcr 0x%x from %s:%d\n", jcr, file, line);
#else
void free_jcr(JCR *jcr)
{
- Dmsg1(400, "Enter free_jcr 0x%x\n", jcr);
+ Dmsg1(3400, "Enter free_jcr 0x%x\n", jcr);
#endif
Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"),
jcr->use_count, jcr->JobId);
}
- Dmsg3(400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
+ Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId);
if (jcr->use_count > 0) { /* if in use */
unlock_jcr_chain();
- Dmsg2(400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "free_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
return;
}
remove_jcr(jcr); /* remove Jcr from chain */
job_end_pop(jcr); /* pop and call hooked routines */
- Dmsg1(400, "End job=%d\n", jcr->JobId);
+ Dmsg1(3400, "End job=%d\n", jcr->JobId);
if (jcr->daemon_free_jcr) {
jcr->daemon_free_jcr(jcr); /* call daemon free routine */
}
free_common_jcr(jcr);
close_msg(NULL); /* flush any daemon messages */
- Dmsg0(400, "Exit free_jcr\n");
+ Dmsg0(3400, "Exit free_jcr\n");
}
-/*
+/*
* Global routine to free a jcr
* JCR chain is already locked
*/
void free_locked_jcr(JCR *jcr)
{
jcr->use_count--; /* decrement use count */
- Dmsg2(400, "Dec free_locked_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Dec free_locked_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
if (jcr->use_count > 0) { /* if in use */
return;
}
/*
- * Given a JobId, find the JCR
+ * Given a JobId, find the JCR
* Returns: jcr on success
* NULL on failure
*/
JCR *get_jcr_by_id(uint32_t JobId)
{
- JCR *jcr;
+ JCR *jcr;
lock_jcr_chain(); /* lock chain */
for (jcr = jobs; jcr; jcr=jcr->next) {
P(jcr->mutex);
jcr->use_count++;
V(jcr->mutex);
- Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
break;
}
}
unlock_jcr_chain();
- return jcr;
+ return jcr;
}
/*
- * Given a SessionId and SessionTime, find the JCR
+ * Given a SessionId and SessionTime, find the JCR
* Returns: jcr on success
* NULL on failure
*/
JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime)
{
- JCR *jcr;
+ JCR *jcr;
lock_jcr_chain();
for (jcr = jobs; jcr; jcr=jcr->next) {
- if (jcr->VolSessionId == SessionId &&
+ if (jcr->VolSessionId == SessionId &&
jcr->VolSessionTime == SessionTime) {
P(jcr->mutex);
jcr->use_count++;
V(jcr->mutex);
- Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
break;
}
}
unlock_jcr_chain();
- return jcr;
+ return jcr;
}
/*
- * Given a Job, find the JCR
+ * Given a Job, find the JCR
* compares on the number of characters in Job
* thus allowing partial matches.
* Returns: jcr on success
*/
JCR *get_jcr_by_partial_name(char *Job)
{
- JCR *jcr;
+ JCR *jcr;
int len;
if (!Job) {
P(jcr->mutex);
jcr->use_count++;
V(jcr->mutex);
- Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
break;
}
}
unlock_jcr_chain();
- return jcr;
+ return jcr;
}
/*
- * Given a Job, find the JCR
+ * Given a Job, find the JCR
* requires an exact match of names.
* Returns: jcr on success
* NULL on failure
*/
JCR *get_jcr_by_full_name(char *Job)
{
- JCR *jcr;
+ JCR *jcr;
if (!Job) {
return NULL;
P(jcr->mutex);
jcr->use_count++;
V(jcr->mutex);
- Dmsg2(400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
break;
}
}
unlock_jcr_chain();
- return jcr;
+ return jcr;
}
void set_jcr_job_status(JCR *jcr, int JobStatus)
static int lock_count = 0;
#endif
-/*
+/*
* Lock the chain
*/
#ifdef TRACE_JCR_CHAIN
#endif
{
int errstat;
-#ifdef TRACE_JCR_CHAIN
- Dmsg3(400, "Lock jcr chain %d from %s:%d\n", ++lock_count,
+#ifdef TRACE_JCR_CHAIN
+ Dmsg3(3400, "Lock jcr chain %d from %s:%d\n", ++lock_count,
fname, line);
#endif
if ((errstat=rwl_writelock(&lock)) != 0) {
#endif
{
int errstat;
-#ifdef TRACE_JCR_CHAIN
- Dmsg3(400, "Unlock jcr chain %d from %s:%d\n", lock_count--,
+#ifdef TRACE_JCR_CHAIN
+ Dmsg3(3400, "Unlock jcr chain %d from %s:%d\n", lock_count--,
fname, line);
#endif
if ((errstat=rwl_writeunlock(&lock)) != 0) {
P(jcr->mutex);
jcr->use_count++;
V(jcr->mutex);
- Dmsg2(400, "Inc get_next_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
+ Dmsg2(3400, "Inc get_next_jcr 0x%x use_count=%d\n", jcr, jcr->use_count);
}
return jcr;
}
BSOCK *fd;
time_t timer_start;
- Dmsg0(400, "Start JCR timeout checks\n");
+ Dmsg0(3400, "Start JCR timeout checks\n");
- /* Walk through all JCRs checking if any one is
+ /* Walk through all JCRs checking if any one is
* blocked for more than specified max time.
*/
lock_jcr_chain();
}
unlock_jcr_chain();
- Dmsg0(400, "Finished JCR timeout checks\n");
+ Dmsg0(3400, "Finished JCR timeout checks\n");
}
/*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Dmsg0(2000, "start scan to eof\n");
while ((token = lex_get_token(lc, T_ALL)) != T_EOL) {
if (token == T_EOB) {
- lex_unget_char(lc);
- return;
+ lex_unget_char(lc);
+ return;
}
}
}
return token;
}
-
+
/*
- * Format a scanner error message
+ * Format a scanner error message
*/
static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
{
va_start(arg_ptr, msg);
bvsnprintf(buf, sizeof(buf), msg, arg_ptr);
va_end(arg_ptr);
-
+
if (lc->line_no > lc->begin_line_no) {
- bsnprintf(more, sizeof(more),
+ bsnprintf(more, sizeof(more),
_("Problem probably begins at line %d.\n"), lc->begin_line_no);
} else {
more[0] = 0;
}
- e_msg(file, line, M_ERROR_TERM, 0, _("Config error: %s\n\
- : line %d, col %d of file %s\n%s\n%s"),
+ e_msg(file, line, M_ERROR_TERM, 0, _("Config error: %s\n"
+" : line %d, col %d of file %s\n%s\n%s"),
buf, lc->line_no, lc->col_no, lc->fname, lc->line, more);
}
return lf;
}
-/*
+/*
* Open a new configuration file. We push the
* state of the current file (lf) so that we
* can do includes. This is a bit of a hammer.
* the next field.
*
*/
-LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error)
-
+LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error)
+
{
LEX *nf;
FILE *fd;
char *fname = bstrdup(filename);
-
+
if ((fd = fopen(fname, "r")) == NULL) {
berrno be;
- Emsg2(M_ERROR_TERM, 0, _("Cannot open config file %s: %s\n"),
- fname, be.strerror());
+ Emsg2(M_ERROR_TERM, 0, _("Cannot open config file %s: %s\n"),
+ fname, be.strerror());
return NULL; /* Never reached if exit_on_error == 1 */
}
Dmsg1(2000, "Open config file: %s\n", fname);
nf = (LEX *)malloc(sizeof(LEX));
- if (lf) {
+ if (lf) {
memcpy(nf, lf, sizeof(LEX));
memset(lf, 0, sizeof(LEX));
- lf->next = nf; /* if have lf, push it behind new one */
+ lf->next = nf; /* if have lf, push it behind new one */
lf->options = nf->options; /* preserve user options */
} else {
- lf = nf; /* start new packet */
+ lf = nf; /* start new packet */
memset(lf, 0, sizeof(LEX));
}
lf->fd = fd;
return lf;
}
-/*
+/*
* Get the next character from the input.
* Returns the character or
* L_EOF if end of file
}
if (lf->ch == L_EOL) {
if (bfgets(lf->line, MAXSTRING, lf->fd) == NULL) {
- lf->ch = L_EOF;
- if (lf->next) {
- lex_close_file(lf);
- }
- return lf->ch;
+ lf->ch = L_EOF;
+ if (lf->next) {
+ lex_close_file(lf);
+ }
+ return lf->ch;
}
lf->line_no++;
lf->col_no = 0;
void lex_unget_char(LEX *lf)
{
- lf->col_no--;
+ lf->col_no--;
if (lf->ch == L_EOL)
lf->ch = 0;
}
{
if (lf->str_len >= MAXSTRING-3) {
Emsg3(M_ERROR_TERM, 0, _(
- _("Config token too long, file: %s, line %d, begins at line %d\n")),
- lf->fname, lf->line_no, lf->begin_line_no);
+ _("Config token too long, file: %s, line %d, begins at line %d\n")),
+ lf->fname, lf->line_no, lf->begin_line_no);
}
lf->str[lf->str_len++] = ch;
lf->str[lf->str_len] = 0;
/*
* Begin the string
*/
-static void begin_str(LEX *lf, int ch)
+static void begin_str(LEX *lf, int ch)
{
lf->str_len = 0;
lf->str[0] = 0;
val = str_to_int64(str);
if (errno != 0 || val < 0) {
scan_err1(lf, _("expected a postive integer number, got: %s"), str);
- /* NOT REACHED */
+ /* NOT REACHED */
}
}
return (uint32_t)val;
}
-/*
- *
+/*
+ *
* Get the next token from the input
*
*/
switch (lf->state) {
case lex_none:
Dmsg2(2000, "Lex state lex_none ch=%d,%x\n", ch, ch);
- if (B_ISSPACE(ch))
- break;
- if (B_ISALPHA(ch)) {
- if (lf->options & LOPT_NO_IDENT)
- lf->state = lex_string;
- else
- lf->state = lex_identifier;
- begin_str(lf, ch);
- break;
- }
- if (B_ISDIGIT(ch)) {
- lf->state = lex_number;
- begin_str(lf, ch);
- break;
- }
+ if (B_ISSPACE(ch))
+ break;
+ if (B_ISALPHA(ch)) {
+ if (lf->options & LOPT_NO_IDENT || lf->options & LOPT_STRING) {
+ lf->state = lex_string;
+ } else {
+ lf->state = lex_identifier;
+ }
+ begin_str(lf, ch);
+ break;
+ }
+ if (B_ISDIGIT(ch)) {
+ if (lf->options & LOPT_STRING) {
+ lf->state = lex_string;
+ } else {
+ lf->state = lex_number;
+ }
+ begin_str(lf, ch);
+ break;
+ }
Dmsg0(2000, "Enter lex_none switch\n");
- switch (ch) {
- case L_EOF:
- token = T_EOF;
+ switch (ch) {
+ case L_EOF:
+ token = T_EOF;
Dmsg0(2000, "got L_EOF set token=T_EOF\n");
- break;
+ break;
case '#':
- lf->state = lex_comment;
- break;
+ lf->state = lex_comment;
+ break;
case '{':
- token = T_BOB;
- begin_str(lf, ch);
- break;
+ token = T_BOB;
+ begin_str(lf, ch);
+ break;
case '}':
- token = T_EOB;
- begin_str(lf, ch);
- break;
+ token = T_EOB;
+ begin_str(lf, ch);
+ break;
case '"':
- lf->state = lex_quoted_string;
- begin_str(lf, 0);
- break;
- case '=':
- token = T_EQUALS;
- begin_str(lf, ch);
- break;
+ lf->state = lex_quoted_string;
+ begin_str(lf, 0);
+ break;
+ case '=':
+ token = T_EQUALS;
+ begin_str(lf, ch);
+ break;
case ',':
- token = T_COMMA;
- begin_str(lf, ch);
- break;
+ token = T_COMMA;
+ begin_str(lf, ch);
+ break;
case ';':
- if (expect != T_SKIP_EOL) {
- token = T_EOL; /* treat ; like EOL */
- }
- break;
- case L_EOL:
+ if (expect != T_SKIP_EOL) {
+ token = T_EOL; /* treat ; like EOL */
+ }
+ break;
+ case L_EOL:
Dmsg0(2000, "got L_EOL set token=T_EOL\n");
- if (expect != T_SKIP_EOL) {
- token = T_EOL;
- }
- break;
+ if (expect != T_SKIP_EOL) {
+ token = T_EOL;
+ }
+ break;
case '@':
- lf->state = lex_include;
- begin_str(lf, 0);
- break;
- default:
- lf->state = lex_string;
- begin_str(lf, ch);
- break;
- }
- break;
+ lf->state = lex_include;
+ begin_str(lf, 0);
+ break;
+ default:
+ lf->state = lex_string;
+ begin_str(lf, ch);
+ break;
+ }
+ break;
case lex_comment:
Dmsg1(2000, "Lex state lex_comment ch=%x\n", ch);
- if (ch == L_EOL) {
- lf->state = lex_none;
- if (expect != T_SKIP_EOL) {
- token = T_EOL;
- }
- } else if (ch == L_EOF) {
- token = T_ERROR;
- }
- break;
+ if (ch == L_EOL) {
+ lf->state = lex_none;
+ if (expect != T_SKIP_EOL) {
+ token = T_EOL;
+ }
+ } else if (ch == L_EOF) {
+ token = T_ERROR;
+ }
+ break;
case lex_number:
Dmsg2(2000, "Lex state lex_number ch=%x %c\n", ch, ch);
- if (ch == L_EOF) {
- token = T_ERROR;
- break;
- }
- /* Might want to allow trailing specifications here */
- if (B_ISDIGIT(ch)) {
- add_str(lf, ch);
- break;
- }
-
- /* A valid number can be terminated by the following */
+ if (ch == L_EOF) {
+ token = T_ERROR;
+ break;
+ }
+ /* Might want to allow trailing specifications here */
+ if (B_ISDIGIT(ch)) {
+ add_str(lf, ch);
+ break;
+ }
+
+ /* A valid number can be terminated by the following */
if (B_ISSPACE(ch) || ch == L_EOL || ch == ',' || ch == ';') {
- token = T_NUMBER;
- lf->state = lex_none;
- } else {
- lf->state = lex_string;
- }
- lex_unget_char(lf);
- break;
+ token = T_NUMBER;
+ lf->state = lex_none;
+ } else {
+ lf->state = lex_string;
+ }
+ lex_unget_char(lf);
+ break;
case lex_ip_addr:
- if (ch == L_EOF) {
- token = T_ERROR;
- break;
- }
+ if (ch == L_EOF) {
+ token = T_ERROR;
+ break;
+ }
Dmsg1(2000, "Lex state lex_ip_addr ch=%x\n", ch);
- break;
+ break;
case lex_string:
Dmsg1(2000, "Lex state lex_string ch=%x\n", ch);
- if (ch == L_EOF) {
- token = T_ERROR;
- break;
- }
+ if (ch == L_EOF) {
+ token = T_ERROR;
+ break;
+ }
if (ch == '\n' || ch == L_EOL || ch == '=' || ch == '}' || ch == '{' ||
ch == '\r' || ch == ';' || ch == ',' || ch == '#' || (B_ISSPACE(ch)) ) {
- lex_unget_char(lf);
- token = T_UNQUOTED_STRING;
- lf->state = lex_none;
- break;
- }
- add_str(lf, ch);
- break;
+ lex_unget_char(lf);
+ token = T_UNQUOTED_STRING;
+ lf->state = lex_none;
+ break;
+ }
+ add_str(lf, ch);
+ break;
case lex_identifier:
Dmsg2(2000, "Lex state lex_identifier ch=%x %c\n", ch, ch);
- if (B_ISALPHA(ch)) {
- add_str(lf, ch);
- break;
- } else if (B_ISSPACE(ch)) {
- break;
+ if (B_ISALPHA(ch)) {
+ add_str(lf, ch);
+ break;
+ } else if (B_ISSPACE(ch)) {
+ break;
} else if (ch == '\n' || ch == L_EOL || ch == '=' || ch == '}' || ch == '{' ||
ch == '\r' || ch == ';' || ch == ',' || ch == '"' || ch == '#') {
- lex_unget_char(lf);
- token = T_IDENTIFIER;
- lf->state = lex_none;
- break;
- } else if (ch == L_EOF) {
- token = T_ERROR;
- lf->state = lex_none;
- begin_str(lf, ch);
- break;
- }
- /* Some non-alpha character => string */
- lf->state = lex_string;
- add_str(lf, ch);
- break;
+ lex_unget_char(lf);
+ token = T_IDENTIFIER;
+ lf->state = lex_none;
+ break;
+ } else if (ch == L_EOF) {
+ token = T_ERROR;
+ lf->state = lex_none;
+ begin_str(lf, ch);
+ break;
+ }
+ /* Some non-alpha character => string */
+ lf->state = lex_string;
+ add_str(lf, ch);
+ break;
case lex_quoted_string:
Dmsg2(2000, "Lex state lex_quoted_string ch=%x %c\n", ch, ch);
- if (ch == L_EOF) {
- token = T_ERROR;
- break;
- }
- if (ch == L_EOL) {
- esc_next = false;
- break;
- }
- if (esc_next) {
- add_str(lf, ch);
- esc_next = false;
- break;
- }
+ if (ch == L_EOF) {
+ token = T_ERROR;
+ break;
+ }
+ if (ch == L_EOL) {
+ esc_next = false;
+ break;
+ }
+ if (esc_next) {
+ add_str(lf, ch);
+ esc_next = false;
+ break;
+ }
if (ch == '\\') {
- esc_next = true;
- break;
- }
+ esc_next = true;
+ break;
+ }
if (ch == '"') {
- token = T_QUOTED_STRING;
- lf->state = lex_none;
- break;
- }
- add_str(lf, ch);
- break;
- case lex_include: /* scanning a filename */
- if (ch == L_EOF) {
- token = T_ERROR;
- break;
- }
+ token = T_QUOTED_STRING;
+ lf->state = lex_none;
+ break;
+ }
+ add_str(lf, ch);
+ break;
+ case lex_include: /* scanning a filename */
+ if (ch == L_EOF) {
+ token = T_ERROR;
+ break;
+ }
if (B_ISSPACE(ch) || ch == '\n' || ch == L_EOL || ch == '}' || ch == '{' ||
ch == ';' || ch == ',' || ch == '"' || ch == '#') {
- lf->state = lex_none;
- lf = lex_open_file(lf, lf->str, NULL);
+ lf->state = lex_none;
+ lf = lex_open_file(lf, lf->str, NULL);
if (lf == NULL) {
- return T_ERROR;
+ return T_ERROR;
}
- break;
- }
- add_str(lf, ch);
- break;
+ break;
+ }
+ add_str(lf, ch);
+ break;
}
Dmsg4(2000, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state),
- lex_tok_to_str(token), ch);
+ lex_tok_to_str(token), ch);
}
Dmsg2(2000, "lex returning: line %d token: %s\n", lf->line_no, lex_tok_to_str(token));
lf->token = token;
- /*
- * Here is where we check to see if the user has set certain
+ /*
+ * Here is where we check to see if the user has set certain
* expectations (e.g. 32 bit integer). If so, we do type checking
* and possible additional scanning (e.g. for range).
*/
case T_PINT32_RANGE:
if (token == T_NUMBER) {
- lf->pint32_val = scan_pint(lf, lf->str);
- lf->pint32_val2 = lf->pint32_val;
- token = T_PINT32;
+ lf->pint32_val = scan_pint(lf, lf->str);
+ lf->pint32_val2 = lf->pint32_val;
+ token = T_PINT32;
} else {
char *p = strchr(lf->str, '-');
- if (!p) {
- scan_err2(lf, _("expected an integer or a range, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
- break;
- }
- *p++ = 0; /* terminate first half of range */
- lf->pint32_val = scan_pint(lf, lf->str);
- lf->pint32_val2 = scan_pint(lf, p);
- token = T_PINT32_RANGE;
+ if (!p) {
+ scan_err2(lf, _("expected an integer or a range, got %s: %s"),
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
+ break;
+ }
+ *p++ = 0; /* terminate first half of range */
+ lf->pint32_val = scan_pint(lf, lf->str);
+ lf->pint32_val2 = scan_pint(lf, p);
+ token = T_PINT32_RANGE;
}
break;
case T_INT32:
if (token != T_NUMBER || !is_a_number(lf->str)) {
scan_err2(lf, _("expected an integer number, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
- break;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
+ break;
}
errno = 0;
lf->int32_val = (int32_t)str_to_int64(lf->str);
if (errno != 0) {
scan_err2(lf, _("expected an integer number, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
} else {
- token = T_INT32;
+ token = T_INT32;
}
break;
case T_INT64:
- Dmsg2(2000, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL));
+ Dmsg2(2000, "int64=:%s: %f\n", lf->str, strtod(lf->str, NULL));
if (token != T_NUMBER || !is_a_number(lf->str)) {
scan_err2(lf, _("expected an integer number, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
- break;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
+ break;
}
errno = 0;
lf->int64_val = str_to_int64(lf->str);
if (errno != 0) {
scan_err2(lf, _("expected an integer number, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
} else {
- token = T_INT64;
+ token = T_INT64;
}
break;
case T_NAME:
if (token != T_IDENTIFIER && token != T_UNQUOTED_STRING && token != T_QUOTED_STRING) {
scan_err2(lf, _("expected a name, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
} else if (lf->str_len > MAX_RES_NAME_LENGTH) {
- scan_err3(lf, _("name %s length %d too long, max is %d\n"), lf->str,
- lf->str_len, MAX_RES_NAME_LENGTH);
- token = T_ERROR;
+ scan_err3(lf, _("name %s length %d too long, max is %d\n"), lf->str,
+ lf->str_len, MAX_RES_NAME_LENGTH);
+ token = T_ERROR;
}
break;
case T_STRING:
if (token != T_IDENTIFIER && token != T_UNQUOTED_STRING && token != T_QUOTED_STRING) {
scan_err2(lf, _("expected a string, got %s: %s"),
- lex_tok_to_str(token), lf->str);
- token = T_ERROR;
+ lex_tok_to_str(token), lf->str);
+ token = T_ERROR;
} else {
- token = T_STRING;
+ token = T_STRING;
}
break;
default:
- break; /* no expectation given */
+ break; /* no expectation given */
}
- lf->token = token; /* set possible new token */
+ lf->token = token; /* set possible new token */
return token;
}
/*
- * lex.h
+ * lex.h
*
* Lexical scanning of configuration files, used by parsers.
*
- * Kern Sibbald, MM
+ * Kern Sibbald, MM
*
* Version $Id$
*
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#define L_EOL (-2)
/* Internal tokens */
-#define T_NONE 100
+#define T_NONE 100
/* Tokens returned by get_token() */
#define T_EOF 101
#define T_ERROR 200
/*
* The following will be returned only if
- * the appropriate expect flag has been set
+ * the appropriate expect flag has been set
*/
#define T_SKIP_EOL 113 /* scan through EOLs */
#define T_PINT32 114 /* positive integer */
/* Lex scan options */
#define LOPT_NO_IDENT 0x1 /* No Identifiers -- use string */
+#define LOPT_STRING 0x2 /* Force scan for string */
/* Lexical context */
typedef struct s_lex_context {
/*
- * Bacula memory pool routines.
+ * Bacula memory pool routines.
*
* The idea behind these routines is that there will be
* pools of memory that are pre-allocated for quick
* access. The pools will have a fixed memory size on allocation
- * but if need be, the size can be increased. This is
+ * but if need be, the size can be increased. This is
* particularly useful for filename
* buffers where 256 bytes should be sufficient in 99.99%
* of the cases, but when it isn't we want to be able to
* there is enough memory, simply call the check_pool_memory_size()
* with the desired size and it will adjust only if necessary.
*
- * Kern E. Sibbald
+ * Kern E. Sibbald
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "bacula.h"
struct s_pool_ctl {
- int32_t size; /* default size */
- int32_t max_allocated; /* max allocated */
- int32_t max_used; /* max buffers used */
- int32_t in_use; /* number in use */
- struct abufhead *free_buf; /* pointer to free buffers */
+ int32_t size; /* default size */
+ int32_t max_allocated; /* max allocated */
+ int32_t max_used; /* max buffers used */
+ int32_t in_use; /* number in use */
+ struct abufhead *free_buf; /* pointer to free buffers */
};
/* Bacula Name length plus extra */
* Define default Pool buffer sizes
*/
static struct s_pool_ctl pool_ctl[] = {
- { 256, 256, 0, 0, NULL }, /* PM_NOPOOL no pooling */
- { NLEN, NLEN,0, 0, NULL }, /* PM_NAME Bacula name */
- { 256, 256, 0, 0, NULL }, /* PM_FNAME filename buffers */
- { 512, 512, 0, 0, NULL }, /* PM_MESSAGE message buffer */
- { 1024, 1024, 0, 0, NULL } /* PM_EMSG error message buffer */
+ { 256, 256, 0, 0, NULL }, /* PM_NOPOOL no pooling */
+ { NLEN, NLEN,0, 0, NULL }, /* PM_NAME Bacula name */
+ { 256, 256, 0, 0, NULL }, /* PM_FNAME filename buffers */
+ { 512, 512, 0, 0, NULL }, /* PM_MESSAGE message buffer */
+ { 1024, 1024, 0, 0, NULL } /* PM_EMSG error message buffer */
};
#else
/* This is used ONLY when stress testing the code */
static struct s_pool_ctl pool_ctl[] = {
- { 20, 20, 0, 0, NULL }, /* PM_NOPOOL no pooling */
- { NLEN, NLEN,0, 0, NULL }, /* PM_NAME Bacula name */
- { 20, 20, 0, 0, NULL }, /* PM_FNAME filename buffers */
- { 20, 20, 0, 0, NULL }, /* PM_MESSAGE message buffer */
- { 20, 20, 0, 0, NULL } /* PM_EMSG error message buffer */
+ { 20, 20, 0, 0, NULL }, /* PM_NOPOOL no pooling */
+ { NLEN, NLEN,0, 0, NULL }, /* PM_NAME Bacula name */
+ { 20, 20, 0, 0, NULL }, /* PM_FNAME filename buffers */
+ { 20, 20, 0, 0, NULL }, /* PM_MESSAGE message buffer */
+ { 20, 20, 0, 0, NULL } /* PM_EMSG error message buffer */
};
#endif
/* Memory allocation control structures and storage. */
struct abufhead {
- int32_t ablen; /* Buffer length in bytes */
- int32_t pool; /* pool */
- struct abufhead *next; /* pointer to next free buffer */
+ int32_t ablen; /* Buffer length in bytes */
+ int32_t pool; /* pool */
+ struct abufhead *next; /* pointer to next free buffer */
};
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pool_ctl[pool].free_buf = buf->next;
pool_ctl[pool].in_use++;
if (pool_ctl[pool].in_use > pool_ctl[pool].max_used) {
- pool_ctl[pool].max_used = pool_ctl[pool].in_use;
+ pool_ctl[pool].max_used = pool_ctl[pool].in_use;
}
V(mutex);
- Dmsg3(300, "sm_get_pool_memory reuse %x to %s:%d\n", buf, fname, lineno);
+ Dmsg3(800, "sm_get_pool_memory reuse %x to %s:%d\n", buf, fname, lineno);
sm_new_owner(fname, lineno, (char *)buf);
return (POOLMEM *)((char *)buf+HEAD_SIZE);
}
-
+
if ((buf = (struct abufhead *)sm_malloc(fname, lineno, pool_ctl[pool].size+HEAD_SIZE)) == NULL) {
V(mutex);
Emsg1(M_ABORT, 0, "Out of memory requesting %d bytes\n", pool_ctl[pool].size);
pool_ctl[pool].max_used = pool_ctl[pool].in_use;
}
V(mutex);
- Dmsg3(300, "sm_get_pool_memory give %x to %s:%d\n", buf, fname, lineno);
+ Dmsg3(800, "sm_get_pool_memory give %x to %s:%d\n", buf, fname, lineno);
return (POOLMEM *)((char *)buf+HEAD_SIZE);
}
pool = buf->pool;
pool_ctl[pool].in_use--;
if (pool == 0) {
- free((char *)buf); /* free nonpooled memory */
- } else { /* otherwise link it to the free pool chain */
+ free((char *)buf); /* free nonpooled memory */
+ } else { /* otherwise link it to the free pool chain */
#ifdef DEBUG
struct abufhead *next;
/* Don't let him free the same buffer twice */
for (next=pool_ctl[pool].free_buf; next; next=next->next) {
- if (next == buf) {
- Dmsg4(300, "bad free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
- V(mutex); /* unblock the pool */
- ASSERT(next != buf); /* attempt to free twice */
- }
+ if (next == buf) {
+ Dmsg4(800, "bad free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
+ V(mutex); /* unblock the pool */
+ ASSERT(next != buf); /* attempt to free twice */
+ }
}
#endif
buf->next = pool_ctl[pool].free_buf;
pool_ctl[pool].free_buf = buf;
}
- Dmsg4(300, "free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
+ Dmsg4(800, "free_pool_memory %x pool=%d from %s:%d\n", buf, pool, fname, lineno);
V(mutex);
}
#else
-/* ========= NO SMARTALLOC ========================================= */
+/* ========= NO SMARTALLOC ========================================= */
POOLMEM *get_pool_memory(int pool)
{
V(mutex);
return (POOLMEM *)((char *)buf+HEAD_SIZE);
}
-
+
if ((buf=malloc(pool_ctl[pool].size+HEAD_SIZE)) == NULL) {
V(mutex);
Emsg1(M_ABORT, 0, "Out of memory requesting %d bytes\n", pool_ctl[pool].size);
pool = buf->pool;
pool_ctl[pool].in_use--;
if (pool == 0) {
- free((char *)buf); /* free nonpooled memory */
- } else { /* otherwise link it to the free pool chain */
+ free((char *)buf); /* free nonpooled memory */
+ } else { /* otherwise link it to the free pool chain */
#ifdef DEBUG
struct abufhead *next;
/* Don't let him free the same buffer twice */
for (next=pool_ctl[pool].free_buf; next; next=next->next) {
- if (next == buf) {
- V(mutex);
- ASSERT(next != buf); /* attempt to free twice */
- }
+ if (next == buf) {
+ V(mutex);
+ ASSERT(next != buf); /* attempt to free twice */
+ }
}
#endif
buf->next = pool_ctl[pool].free_buf;
pool_ctl[pool].free_buf = buf;
}
- Dmsg2(300, "free_pool_memory %x pool=%d\n", buf, pool);
+ Dmsg2(800, "free_pool_memory %x pool=%d\n", buf, pool);
V(mutex);
}
for (int i=1; i<=PM_MAX; i++) {
buf = pool_ctl[i].free_buf;
while (buf) {
- next = buf->next;
- free((char *)buf);
- buf = next;
+ next = buf->next;
+ free((char *)buf);
+ buf = next;
}
pool_ctl[i].free_buf = NULL;
}
sprintf(buf, "%-6d", pool);
return buf;
}
-
-/* Print staticstics on memory pool usage
- */
+
+/* Print staticstics on memory pool usage
+ */
void print_memory_pool_stats()
{
Dmsg0(-1, "Pool Maxsize Maxused Inuse\n");
for (int i=0; i<=PM_MAX; i++)
Dmsg4(-1, "%5s %7d %7d %5d\n", pool_name(i), pool_ctl[i].max_allocated,
- pool_ctl[i].max_used, pool_ctl[i].in_use);
+ pool_ctl[i].max_used, pool_ctl[i].in_use);
Dmsg0(-1, "\n");
}
#else
-void print_memory_pool_stats() {}
+void print_memory_pool_stats() {}
#endif /* DEBUG */
int pm_strcpy(POOL_MEM &pm, const char *str)
-{
+{
int len = strlen(str) + 1;
pm.check_size(len);
memcpy(pm.c_str(), str, len);
int POOL_MEM::strcpy(const char *str)
-{
+{
int len = strlen(str) + 1;
check_size(len);
memcpy(mem, str, len);
/*
* Bacula message handling routines
*
- * Kern Sibbald, April 2000
+ * Kern Sibbald, April 2000
*
* Version $Id$
*
#define FULL_LOCATION 1 /* set for file:line in Debug messages */
-/*
+/*
* This is where we define "Globals" because all the
* daemons include this file.
*/
#else
#ifdef HAVE_MYSQL
char catalog_db[] = "MySQL";
-#else
+#else
#ifdef HAVE_SQLITE
char catalog_db[] = "SQLite";
#else
/* Define if e_msg must exit when M_ERROR_TERM is received */
static int exit_on_error = 1;
-/*
+/*
* Set daemon name. Also, find canonical execution
* path. Note, exepath has spare room for tacking on
* the exename so that we can reconstruct the full name.
}
}
-/*
+/*
* Initialize message handler for a daemon or a Job
* We make a copy of the MSGS resource passed, so it belows
* to the job or daemon and thus can be modified.
- *
+ *
* NULL for jcr -> initialize global messages for daemon
* non-NULL -> initialize jcr using Message resource
*/
}
if (rwl_init(&con_lock) != 0) {
berrno be;
- Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"),
+ Emsg1(M_ERROR_TERM, 0, _("Could not get con mutex: ERR=%s\n"),
be.strerror());
}
}
-/*
+/*
* Called only during parsing of the config file.
*
* Add a message destination. I.e. associate a message type with
*/
void add_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where, char *mail_cmd)
{
- DEST *d;
+ DEST *d;
/*
* First search the existing chain and see if we
* can simply add this msg_type to an existing entry.
*/
for (d=msg->dest_chain; d; d=d->next) {
if (dest_code == d->dest_code && ((where == NULL && d->where == NULL) ||
- (strcmp(where, d->where) == 0))) {
- Dmsg4(200, "Add to existing d=%x msgtype=%d destcode=%d where=%s\n",
+ (strcmp(where, d->where) == 0))) {
+ Dmsg4(850, "Add to existing d=%x msgtype=%d destcode=%d where=%s\n",
d, msg_type, dest_code, NPRT(where));
set_bit(msg_type, d->msg_types);
set_bit(msg_type, msg->send_msg); /* set msg_type bit in our local */
if (mail_cmd) {
d->mail_cmd = bstrdup(mail_cmd);
}
- Dmsg5(200, "add new d=%x msgtype=%d destcode=%d where=%s mailcmd=%s\n",
+ Dmsg5(850, "add new d=%x msgtype=%d destcode=%d where=%s mailcmd=%s\n",
d, msg_type, dest_code, NPRT(where), NPRT(d->mail_cmd));
msg->dest_chain = d;
}
-/*
+/*
* Called only during parsing of the config file.
*
- * Remove a message destination
+ * Remove a message destination
*/
void rem_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where)
{
DEST *d;
for (d=msg->dest_chain; d; d=d->next) {
- Dmsg2(200, "Remove_msg_dest d=%x where=%s\n", d, NPRT(d->where));
+ Dmsg2(850, "Remove_msg_dest d=%x where=%s\n", d, NPRT(d->where));
if (bit_is_set(msg_type, d->msg_types) && (dest_code == d->dest_code) &&
((where == NULL && d->where == NULL) ||
- (strcmp(where, d->where) == 0))) {
- Dmsg3(200, "Found for remove d=%x msgtype=%d destcode=%d\n",
+ (strcmp(where, d->where) == 0))) {
+ Dmsg3(850, "Found for remove d=%x msgtype=%d destcode=%d\n",
d, msg_type, dest_code);
clear_bit(msg_type, d->msg_types);
- Dmsg0(200, "Return rem_msg_dest\n");
+ Dmsg0(850, "Return rem_msg_dest\n");
return;
}
}
Mmsg(name, "%s/%s.mail.%s.%d", working_directory, my_name,
my_name, (int)(long)d);
}
- Dmsg1(200, "mailname=%s\n", name);
+ Dmsg1(850, "mailname=%s\n", name);
}
/*
static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
{
BPIPE *bpipe;
-
+
if (d->mail_cmd) {
cmd = edit_job_codes(jcr, cmd, d->mail_cmd, d->where);
} else {
if (!(bpipe = open_bpipe(cmd, 120, "rw"))) {
berrno be;
- Jmsg(jcr, M_ERROR, 0, "open mail pipe %s failed: ERR=%s\n",
+ Jmsg(jcr, M_ERROR, 0, "open mail pipe %s failed: ERR=%s\n",
cmd, be.strerror());
}
if (!d->mail_cmd) {
fprintf(bpipe->wfd, "Subject: Bacula Message\r\n\r\n");
}
-
+
return bpipe;
}
-/*
+/*
* Close the messages for this Messages resource, which means to close
* any open files, and dispatch any pending email messages.
*/
BPIPE *bpipe;
POOLMEM *cmd, *line;
int len, stat;
-
- Dmsg1(350, "Close_msg jcr=0x%x\n", jcr);
+
+ Dmsg1(850, "Close_msg jcr=0x%x\n", jcr);
if (jcr == NULL) { /* NULL -> global chain */
msgs = daemon_msgs;
if (msgs == NULL) {
return;
}
- Dmsg1(350, "===Begin close msg resource at 0x%x\n", msgs);
+ Dmsg1(850, "===Begin close msg resource at 0x%x\n", msgs);
cmd = get_pool_memory(PM_MESSAGE);
for (d=msgs->dest_chain; d; ) {
if (d->fd) {
break;
case MD_MAIL:
case MD_MAIL_ON_ERROR:
- Dmsg0(350, "Got MD_MAIL or MD_MAIL_ON_ERROR\n");
+ Dmsg0(850, "Got MD_MAIL or MD_MAIL_ON_ERROR\n");
if (!d->fd) {
break;
}
jcr->JobStatus == JS_Terminated) {
goto rem_temp_file;
}
-
+
if (!(bpipe=open_mail_pipe(jcr, cmd, d))) {
Pmsg0(000, "open mail pipe failed.\n");
goto rem_temp_file;
}
- Dmsg0(350, "Opened mail pipe\n");
+ Dmsg0(850, "Opened mail pipe\n");
len = d->max_len+10;
line = get_memory(len);
rewind(d->fd);
if (stat != 0 && msgs != daemon_msgs) {
berrno be;
be.set_errno(stat);
- Dmsg1(350, "Calling emsg. CMD=%s\n", cmd);
+ Dmsg1(850, "Calling emsg. CMD=%s\n", cmd);
Jmsg2(jcr, M_ERROR, 0, _("Mail program terminated in error.\n"
"CMD=%s\n"
"ERR=%s\n"), cmd, be.strerror());
unlink(d->mail_filename);
free_pool_memory(d->mail_filename);
d->mail_filename = NULL;
- Dmsg0(350, "end mail or mail on error\n");
+ Dmsg0(850, "end mail or mail on error\n");
break;
default:
break;
d = d->next; /* point to next buffer */
}
free_pool_memory(cmd);
- Dmsg0(350, "Done walking message chain.\n");
+ Dmsg0(850, "Done walking message chain.\n");
if (jcr) {
free_msgs_res(msgs);
msgs = NULL;
} else {
V(mutex);
}
- Dmsg0(350, "===End close msg resource\n");
+ Dmsg0(850, "===End close msg resource\n");
}
/*
- * Free memory associated with Messages resource
+ * Free memory associated with Messages resource
*/
void free_msgs_res(MSGS *msgs)
{
}
-/*
- * Terminate the message handler for good.
+/*
+ * Terminate the message handler for good.
* Release the global destination chain.
- *
+ *
* Also, clean up a few other items (cons, exepath). Note,
* these really should be done elsewhere.
*/
void term_msg()
{
- Dmsg0(300, "Enter term_msg\n");
+ Dmsg0(850, "Enter term_msg\n");
close_msg(NULL); /* close global chain */
free_msgs_res(daemon_msgs); /* free the resources */
daemon_msgs = NULL;
*/
void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg)
{
- DEST *d;
+ DEST *d;
char dt[MAX_TIME_LENGTH];
POOLMEM *mcmd;
int len, dtlen;
MSGS *msgs;
BPIPE *bpipe;
- Dmsg2(800, "Enter dispatch_msg type=%d msg=%s\n", type, msg);
+ Dmsg2(850, "Enter dispatch_msg type=%d msg=%s\n", type, msg);
/*
* Most messages are prefixed by a date and time. If mtime is
*/
if (mtime == 0) {
mtime = time(NULL);
- }
+ }
if (mtime == 1) {
*dt = 0;
dtlen = 0;
msgs = NULL;
if (jcr) {
msgs = jcr->jcr_msgs;
- }
+ }
if (msgs == NULL) {
msgs = daemon_msgs;
}
if (bit_is_set(type, d->msg_types)) {
switch (d->dest_code) {
case MD_CONSOLE:
- Dmsg1(800, "CONSOLE for following msg: %s", msg);
+ Dmsg1(850, "CONSOLE for following msg: %s", msg);
if (!con_fd) {
con_fd = fopen(con_fname, "a+");
- Dmsg0(800, "Console file not open.\n");
+ Dmsg0(850, "Console file not open.\n");
}
if (con_fd) {
Pw(con_lock); /* get write lock on console message file */
}
break;
case MD_SYSLOG:
- Dmsg1(800, "SYSLOG for collowing msg: %s\n", msg);
+ Dmsg1(850, "SYSLOG for collowing msg: %s\n", msg);
/*
- * We really should do an openlog() here.
+ * We really should do an openlog() here.
*/
syslog(LOG_DAEMON|LOG_ERR, "%s", msg);
break;
case MD_OPERATOR:
- Dmsg1(800, "OPERATOR for following msg: %s\n", msg);
+ Dmsg1(850, "OPERATOR for following msg: %s\n", msg);
mcmd = get_pool_memory(PM_MESSAGE);
if ((bpipe=open_mail_pipe(jcr, mcmd, d))) {
int stat;
break;
case MD_MAIL:
case MD_MAIL_ON_ERROR:
- Dmsg1(800, "MAIL for following msg: %s", msg);
+ Dmsg1(850, "MAIL for following msg: %s", msg);
if (!d->fd) {
POOLMEM *name = get_pool_memory(PM_MESSAGE);
make_unique_mail_filename(jcr, name, d);
if (!d->fd) {
berrno be;
d->fd = stdout;
- Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name,
+ Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name,
be.strerror());
d->fd = NULL;
free_pool_memory(name);
fputs(msg, d->fd);
break;
case MD_FILE:
- Dmsg1(800, "FILE for following msg: %s", msg);
+ Dmsg1(850, "FILE for following msg: %s", msg);
if (!d->fd) {
d->fd = fopen(d->where, "w+");
if (!d->fd) {
berrno be;
d->fd = stdout;
- Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
+ Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
be.strerror());
d->fd = NULL;
break;
fputs(msg, d->fd);
break;
case MD_APPEND:
- Dmsg1(800, "APPEND for following msg: %s", msg);
+ Dmsg1(850, "APPEND for following msg: %s", msg);
if (!d->fd) {
d->fd = fopen(d->where, "a");
if (!d->fd) {
berrno be;
d->fd = stdout;
- Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
+ Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where,
be.strerror());
d->fd = NULL;
break;
fputs(msg, d->fd);
break;
case MD_DIRECTOR:
- Dmsg1(800, "DIRECTOR for following msg: %s", msg);
+ Dmsg1(850, "DIRECTOR for following msg: %s", msg);
if (jcr && jcr->dir_bsock && !jcr->dir_bsock->errors) {
- bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s",
+ bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s",
jcr->Job, type, mtime, msg);
}
break;
case MD_STDOUT:
- Dmsg1(800, "STDOUT for following msg: %s", msg);
+ Dmsg1(850, "STDOUT for following msg: %s", msg);
if (type != M_ABORT && type != M_ERROR_TERM) { /* already printed */
fputs(dt, stdout);
fputs(msg, stdout);
}
break;
case MD_STDERR:
- Dmsg1(800, "STDERR for following msg: %s", msg);
+ Dmsg1(850, "STDERR for following msg: %s", msg);
fputs(dt, stderr);
fputs(msg, stderr);
break;
* is less than or equal the debug_level. File and line numbers
* are included for more detail if desired, but not currently
* printed.
- *
+ *
* If the level is negative, the details of file and line number
* are not printed.
*/
-void
+void
d_msg(const char *file, int line, int level, const char *fmt,...)
{
char buf[5000];
bvsnprintf(buf+len, sizeof(buf)-len, (char *)fmt, arg_ptr);
va_end(arg_ptr);
- /*
+ /*
* Used the "trace on" command in the console to turn on
* output to the trace file. "trace off" will close the file.
*/
}
/*
- * Set trace flag on/off. If argument is negative, there is no change
+ * Set trace flag on/off. If argument is negative, there is no change
*/
void set_trace(int trace_flag)
{
/*********************************************************************
*
* This subroutine prints a message regardless of the debug level
- *
+ *
* If the level is negative, the details of file and line number
* are not printed.
*/
-void
+void
p_msg(const char *file, int line, int level, const char *fmt,...)
{
char buf[5000];
* is less than or equal the debug_level. File and line numbers
* are included for more detail if desired, but not currently
* printed.
- *
+ *
* If the level is negative, the details of file and line number
* are not printed.
*/
-void
+void
t_msg(const char *file, int line, int level, const char *fmt,...)
{
char buf[5000];
bsnprintf(buf, sizeof(buf), "%s/bacula.trace", working_directory);
trace_fd = fopen(buf, "a+");
}
-
+
#ifdef FULL_LOCATION
if (details) {
len = bsnprintf(buf, sizeof(buf), "%s: %s:%d ", my_name, file, line);
* print an error message
*
*/
-void
+void
e_msg(const char *file, int line, int type, int level, const char *fmt,...)
{
char buf[5000];
va_list arg_ptr;
int len;
- /*
- * Check if we have a message destination defined.
- * We always report M_ABORT and M_ERROR_TERM
+ /*
+ * Check if we have a message destination defined.
+ * We always report M_ABORT and M_ERROR_TERM
*/
- if (!daemon_msgs || ((type != M_ABORT && type != M_ERROR_TERM) &&
+ if (!daemon_msgs || ((type != M_ABORT && type != M_ERROR_TERM) &&
!bit_is_set(type, daemon_msgs->send_msg))) {
return; /* no destination */
}
switch (type) {
case M_ABORT:
- len = bsnprintf(buf, sizeof(buf), "%s: ABORTING due to ERROR in %s:%d\n",
+ len = bsnprintf(buf, sizeof(buf), "%s: ABORTING due to ERROR in %s:%d\n",
my_name, file, line);
break;
case M_ERROR_TERM:
- len = bsnprintf(buf, sizeof(buf), "%s: ERROR TERMINATION at %s:%d\n",
+ len = bsnprintf(buf, sizeof(buf), "%s: ERROR TERMINATION at %s:%d\n",
my_name, file, line);
break;
case M_FATAL:
* Generate a Job message
*
*/
-void
+void
Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...)
{
char rbuf[5000];
MSGS *msgs;
const char *job;
-
- Dmsg1(800, "Enter Jmsg type=%d\n", type);
+
+ Dmsg1(850, "Enter Jmsg type=%d\n", type);
/* Special case for the console, which has a dir_bsock and JobId==0,
* in that case, we send the message directly back to the
- * dir_bsock.
+ * dir_bsock.
*/
if (jcr && jcr->JobId == 0 && jcr->dir_bsock) {
BSOCK *dir = jcr->dir_bsock;
va_start(arg_ptr, fmt);
- dir->msglen = bvsnprintf(dir->msg, sizeof_pool_memory(dir->msg),
+ dir->msglen = bvsnprintf(dir->msg, sizeof_pool_memory(dir->msg),
fmt, arg_ptr);
va_end(arg_ptr);
bnet_send(jcr->dir_bsock);
if (jcr) {
msgs = jcr->jcr_msgs;
job = jcr->Job;
- }
+ }
if (!msgs) {
msgs = daemon_msgs; /* if no jcr, we use daemon handler */
}
job = ""; /* Set null job name if none */
}
- /*
- * Check if we have a message destination defined.
- * We always report M_ABORT and M_ERROR_TERM
+ /*
+ * Check if we have a message destination defined.
+ * We always report M_ABORT and M_ERROR_TERM
*/
if (msgs && (type != M_ABORT && type != M_ERROR_TERM) &&
!bit_is_set(type, msgs->send_msg)) {
i = Mmsg(pool_buf, "%s:%d ", file, line);
for (;;) {
- maxlen = sizeof_pool_memory(pool_buf) - i - 1;
+ maxlen = sizeof_pool_memory(pool_buf) - i - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
/*
* Edit a message into a Pool memory buffer, with file:lineno
- */
+ */
int m_msg(const char *file, int line, POOLMEM **pool_buf, const char *fmt, ...)
{
va_list arg_ptr;
i = sprintf(*pool_buf, "%s:%d ", file, line);
for (;;) {
- maxlen = sizeof_pool_memory(*pool_buf) - i - 1;
+ maxlen = sizeof_pool_memory(*pool_buf) - i - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(*pool_buf+i, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
i = sprintf(pool_buf, "%s:%d ", file, line);
for (;;) {
- maxlen = sizeof_pool_memory(pool_buf) - i - 1;
+ maxlen = sizeof_pool_memory(pool_buf) - i - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
int len, maxlen;
for (;;) {
- maxlen = sizeof_pool_memory(*pool_buf) - 1;
+ maxlen = sizeof_pool_memory(*pool_buf) - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(*pool_buf, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
int len, maxlen;
for (;;) {
- maxlen = sizeof_pool_memory(pool_buf) - 1;
+ maxlen = sizeof_pool_memory(pool_buf) - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
int len, maxlen;
for (;;) {
- maxlen = pool_buf.max_size() - 1;
+ maxlen = pool_buf.max_size() - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf.c_str(), maxlen, fmt, arg_ptr);
va_end(arg_ptr);
/*
* We queue messages rather than print them directly. This
* is generally used in low level routines (msg handler, bnet)
- * to prevent recursion (i.e. if you are in the middle of
+ * to prevent recursion (i.e. if you are in the middle of
* sending a message, it is a bit messy to recursively call
* yourself when the bnet packet is not reentrant).
*/
pool_buf = get_pool_memory(PM_EMSG);
for (;;) {
- maxlen = sizeof_pool_memory(pool_buf) - 1;
+ maxlen = sizeof_pool_memory(pool_buf) - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
item = (MQUEUE_ITEM *)malloc(sizeof(MQUEUE_ITEM) + strlen(pool_buf) + 1);
item->type = type;
item->mtime = time(NULL);
- strcpy(item->msg, pool_buf);
+ strcpy(item->msg, pool_buf);
/* If no jcr or dequeuing send to daemon to avoid recursion */
if (!jcr || jcr->dequeuing) {
/* jcr==NULL => daemon message, safe to send now */
}
/*
- * Dequeue messages
+ * Dequeue messages
*/
void dequeue_messages(JCR *jcr)
{
jcr->msg_queue->destroy();
jcr->dequeuing = false;
V(msg_queue_mutex);
-}
+}
/*
i = Mmsg(pool_buf, "%s:%d ", file, line);
for (;;) {
- maxlen = sizeof_pool_memory(pool_buf) - i - 1;
+ maxlen = sizeof_pool_memory(pool_buf) - i - 1;
va_start(arg_ptr, fmt);
len = bvsnprintf(pool_buf+i, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
free_memory(pool_buf);
}
-/*
+/*
* Define if e_msg must exit when M_ERROR_TERM is received
*/
void set_exit_on_error(int value) {
* Version $Id$
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need);
BSOCK * bnet_connect (JCR *jcr, int retry_interval,
- int max_retry_time, const char *name, char *host, char *service,
+ int max_retry_time, const char *name, char *host, char *service,
int port, int verbose);
void bnet_close (BSOCK *bsock);
-BSOCK * init_bsock (JCR *jcr, int sockfd, const char *who, const char *ip,
+BSOCK * init_bsock (JCR *jcr, int sockfd, const char *who, const char *ip,
int port, struct sockaddr *client_addr);
BSOCK * dup_bsock (BSOCK *bsock);
void term_bsock (BSOCK *bsock);
char * edit_uint64_with_commas (uint64_t val, char *buf);
char * add_commas (char *val, char *buf);
char * edit_uint64 (uint64_t val, char *buf);
+char * edit_int64 (int64_t val, char *buf);
int duration_to_utime (char *str, utime_t *value);
int size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
char *edit_utime (utime_t val, char *buf, int buf_len);
void set_exit_on_error (int value);
/* bnet_server.c */
-void bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq,
+void bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq,
void *handle_client_request(void *bsock));
void bnet_stop_thread_server(pthread_t tid);
void bnet_server (int port, void handle_client_request(BSOCK *bsock));
char *getgroup (gid_t gid);
void free_getgroup_cache();
+/* python.c */
+typedef int (EVENT_HANDLER)(JCR *jcr, const char *event);
+void init_python_interpreter(const char *progname, const char *scripts);
+void term_python_interpreter();
+extern EVENT_HANDLER *generate_event;
/* signal.c */
void init_signals (void terminate(int sig));
bool skip_nonspaces (char **msg);
int fstrsch (const char *a, const char *b);
char *next_arg(char **s);
-int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
+int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
char **argk, char **argv, int max_args);
-void split_path_and_filename(const char *fname, POOLMEM **path,
+void split_path_and_filename(const char *fname, POOLMEM **path,
int *pnl, POOLMEM **file, int *fnl);
int bsscanf(const char *buf, const char *fmt, ...);
int do_shell_expansion (char *name, int name_len);
void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen);
int run_program (char *prog, int wait, POOLMEM *results);
+int run_program_full_output (char *prog, int wait, POOLMEM *results);
const char * job_type_to_str (int type);
const char * job_status_to_str (int stat);
const char * job_level_to_str (int level);
/*
* scan.c -- scanning routines for Bacula
- *
+ *
* Kern Sibbald, MM separated from util.c MMIII
*
* Version $Id$
/*
* Skip spaces
- * Returns: 0 on failure (EOF)
+ * Returns: 0 on failure (EOF)
* 1 on success
- * new address in passed parameter
+ * new address in passed parameter
*/
bool skip_spaces(char **msg)
{
/*
* Skip nonspaces
- * Returns: 0 on failure (EOF)
+ * Returns: 0 on failure (EOF)
* 1 on success
- * new address in passed parameter
+ * new address in passed parameter
*/
bool skip_nonspaces(char **msg)
{
}
-/*
+/*
* Return next argument from command line. Note, this
* routine is destructive.
*/
/* skip past spaces to next arg */
for (p=*s; *p && B_ISSPACE(*p); ) {
p++;
- }
- Dmsg1(400, "Next arg=%s\n", p);
+ }
+ Dmsg1(900, "Next arg=%s\n", p);
for (n = q = p; *p ; ) {
if (*p == '\\') {
p++;
}
*q = 0;
*s = p;
- Dmsg2(400, "End arg=%s next=%s\n", n, p);
+ Dmsg2(900, "End arg=%s next=%s\n", n, p);
return n;
-}
+}
/*
* This routine parses the input command line.
* It makes a copy in args, then builds an
* argc, argv like list where
- *
+ *
* argc = count of arguments
* argk[i] = argument keyword (part preceding =)
* argv[i] = argument value (part after =)
* argk[1] = arg2
* argv[1] = abc
* argk[2] = arg3
- * argv[2] =
+ * argv[2] =
*/
-int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
- char **argk, char **argv, int max_args)
+int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
+ char **argk, char **argv, int max_args)
{
char *p, *q, *n;
*argc = 0;
/* Pick up all arguments */
while (*argc < max_args) {
- n = next_arg(&p);
+ n = next_arg(&p);
if (*n) {
argk[*argc] = n;
argv[(*argc)++] = NULL;
int len = slen = strlen(fname);
/*
- * Find path without the filename.
+ * Find path without the filename.
* I.e. everything after the last / is a "filename".
* OK, maybe it is a directory name, but we treat it like
* a filename. If we don't find a / then the whole name
}
/*
- * Extremely simple sscanf. Handles only %(u,d,ld,lu,lld,llu,c,nns)
+ * Extremely simple sscanf. Handles only %(u,d,ld,lu,lld,llu,c,nns)
*/
const int BIG = 1000;
int bsscanf(const char *buf, const char *fmt, ...)
int cnt;
char *helloreq= "Hello *UserAgent* calling\n";
char *hello = "Hello %127s calling\n";
- char *catreq =
+ char *catreq =
"CatReq Job=NightlySave.2004-06-11_19.11.32 CreateJobMedia FirstIndex=1 LastIndex=114 StartFile=0 EndFile=0 StartBlock=208 EndBlock=2903248";
static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia "
"FirstIndex=%u LastIndex=%u StartFile=%u EndFile=%u "
uint64_t VolWriteTime; /* time spent writing this Volume */
char VolCatStatus[20]; /* Volume status */
char VolCatName[MAX_NAME_LENGTH]; /* Desired volume to mount */
-};
+};
struct VOLUME_CAT_INFO vol;
#ifdef xxx
/*
* util.c miscellaneous utility subroutines for Bacula
- *
+ *
* Kern Sibbald, MM
*
* Version $Id$
}
}
-/* Convert spaces to non-space character.
+/* Convert spaces to non-space character.
* This makes scanf of fields containing spaces easier.
*/
void
}
}
-/* Convert spaces to non-space character.
+/* Convert spaces to non-space character.
* This makes scanf of fields containing spaces easier.
*/
void
{
while (*str) {
if (*str == 0x1)
- *str = ' ';
+ *str = ' ';
str++;
}
}
char *str = pm.c_str();
while (*str) {
if (*str == 0x1)
- *str = ' ';
+ *str = ' ';
str++;
}
}
if (JobStatus == 0) {
buf[0] = 0;
} else {
- bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
+ bsnprintf(buf, sizeof(buf), _("Unknown Job termination status=%d"), JobStatus);
}
jobstat = buf;
break;
/*
* Convert Job Termination Status into a string
*/
-const char *job_status_to_str(int stat)
+const char *job_status_to_str(int stat)
{
const char *str;
/*
* Convert Job Type into a string
*/
-const char *job_type_to_str(int type)
+const char *job_type_to_str(int type)
{
const char *str;
/*
* Convert Job Level into a string
*/
-const char *job_level_to_str(int level)
+const char *job_level_to_str(int level)
{
const char *str;
char *encode_mode(mode_t mode, char *buf)
{
- char *cp = buf;
+ char *cp = buf;
*cp++ = S_ISDIR(mode) ? 'd' : S_ISBLK(mode) ? 'b' : S_ISCHR(mode) ? 'c' :
- S_ISLNK(mode) ? 'l' : S_ISFIFO(mode) ? 'f' : S_ISSOCK(mode) ? 's' : '-';
+ S_ISLNK(mode) ? 'l' : S_ISFIFO(mode) ? 'f' : S_ISSOCK(mode) ? 's' : '-';
*cp++ = mode & S_IRUSR ? 'r' : '-';
*cp++ = mode & S_IWUSR ? 'w' : '-';
*cp++ = (mode & S_ISUID
- ? (mode & S_IXUSR ? 's' : 'S')
- : (mode & S_IXUSR ? 'x' : '-'));
+ ? (mode & S_IXUSR ? 's' : 'S')
+ : (mode & S_IXUSR ? 'x' : '-'));
*cp++ = mode & S_IRGRP ? 'r' : '-';
*cp++ = mode & S_IWGRP ? 'w' : '-';
*cp++ = (mode & S_ISGID
- ? (mode & S_IXGRP ? 's' : 'S')
- : (mode & S_IXGRP ? 'x' : '-'));
+ ? (mode & S_IXGRP ? 's' : 'S')
+ : (mode & S_IXGRP ? 'x' : '-'));
*cp++ = mode & S_IROTH ? 'r' : '-';
*cp++ = mode & S_IWOTH ? 'w' : '-';
*cp++ = (mode & S_ISVTX
- ? (mode & S_IXOTH ? 't' : 'T')
- : (mode & S_IXOTH ? 'x' : '-'));
+ ? (mode & S_IXOTH ? 't' : 'T')
+ : (mode & S_IXOTH ? 'x' : '-'));
*cp = '\0';
return cp;
}
cmd = get_pool_memory(PM_FNAME);
/* look for shell */
if ((shellcmd = getenv("SHELL")) == NULL) {
- shellcmd = "/bin/sh";
+ shellcmd = "/bin/sh";
}
pm_strcpy(&cmd, shellcmd);
pm_strcat(&cmd, " -c \"echo ");
fgets(line, sizeof(line), bpipe->rfd);
strip_trailing_junk(line);
stat = close_bpipe(bpipe);
- Dmsg2(400, "stat=%d got: %s\n", stat, line);
+ Dmsg2(400, "stat=%d got: %s\n", stat, line);
} else {
stat = 1; /* error */
}
/* The following creates a seed for the session key generator
based on a collection of volatile and environment-specific
information unlikely to be vulnerable (as a whole) to an
- exhaustive search attack. If one of these items isn't
+ exhaustive search attack. If one of these items isn't
available on your machine, replace it with something
equivalent or, if you like, just delete it. */
key[k++] = Rad16(rb & 0xF);
#undef Rad16
if (j & 1) {
- key[k++] = '-';
+ key[k++] = '-';
}
}
key[--k] = 0;
*
* omsg = edited output message
* imsg = input string containing edit codes (%x)
- * to = recepients list
+ * to = recepients list
*
*/
-POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
+POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
{
char *p, *q;
const char *str;
for (p=imsg; *p; p++) {
if (*p == '%') {
switch (*++p) {
- case '%':
- str = "%";
+ case '%':
+ str = "%";
break;
- case 'c':
+ case 'c':
if (jcr) {
str = jcr->client_name;
} else {
- str = "*none*";
- }
- if (!str) {
- str = "";
+ str = "*none*";
}
break;
- case 'd':
- str = my_name; /* Director's name */
+ case 'd':
+ str = my_name; /* Director's name */
break;
- case 'e':
+ case 'e':
if (jcr) {
- str = job_status_to_str(jcr->JobStatus);
- } else {
- str = "*none*";
+ str = job_status_to_str(jcr->JobStatus);
+ } else {
+ str = "*none*";
}
break;
- case 'i':
+ case 'i':
if (jcr) {
- bsnprintf(add, sizeof(add), "%d", jcr->JobId);
+ bsnprintf(add, sizeof(add), "%d", jcr->JobId);
str = add;
} else {
- str = "*none*";
+ str = "*none*";
}
break;
- case 'j': /* Job name */
+ case 'j': /* Job name */
if (jcr) {
str = jcr->Job;
} else {
- str = "*none*";
+ str = "*none*";
}
break;
- case 'l':
+ case 'l':
if (jcr) {
str = job_level_to_str(jcr->JobLevel);
} else {
- str = "*none*";
+ str = "*none*";
}
break;
- case 'n':
+ case 'n':
if (jcr) {
bstrncpy(name, jcr->Job, sizeof(name));
/* There are three periods after the Job name */
for (i=0; i<3; i++) {
- if ((q=strrchr(name, '.')) != NULL) {
+ if ((q=strrchr(name, '.')) != NULL) {
*q = 0;
}
}
str = name;
} else {
- str = "*none*";
+ str = "*none*";
}
break;
- case 'r':
+ case 'r':
str = to;
break;
- case 't':
+ case 't':
if (jcr) {
str = job_type_to_str(jcr->JobType);
} else {
- str = "*none*";
+ str = "*none*";
}
break;
- case 'v':
+ case 'v':
if (jcr) {
if (jcr->VolumeName && jcr->VolumeName[0]) {
str = jcr->VolumeName;
} else {
- str = "";
+ str = "";
}
} else {
- str = "*none*";
+ str = "*none*";
}
break;
default:
- add[0] = '%';
+ add[0] = '%';
add[1] = *p;
add[2] = 0;
str = add;
void set_working_directory(char *wd)
{
- struct stat stat_buf;
+ struct stat stat_buf;
if (wd == NULL) {
Emsg0(M_ERROR_TERM, 0, _("Working directory not defined. Cannot continue.\n"));
static dlist *wd_queue;
static dlist *wd_inactive;
-/*
+/*
* Start watchdog thread
*
* Returns: 0 on success
if (wd_is_init) {
return 0;
}
- Dmsg0(400, "Initialising NicB-hacked watchdog thread\n");
+ Dmsg0(800, "Initialising NicB-hacked watchdog thread\n");
watchdog_time = time(NULL);
if ((errstat=rwl_init(&lock)) != 0) {
- Emsg1(M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"),
+ Emsg1(M_ABORT, 0, _("Unable to initialize watchdog lock. ERR=%s\n"),
strerror(errstat));
}
wd_queue = New(dlist(dummy, &dummy->link));
int stop_watchdog(void)
{
int stat;
- watchdog_t *p;
+ watchdog_t *p;
if (!wd_is_init) {
return 0;
wd_lock();
wd->next_fire = watchdog_time + wd->interval;
wd_queue->append(wd);
- Dmsg3(400, "Registered watchdog %p, interval %d%s\n",
+ Dmsg3(800, "Registered watchdog %p, interval %d%s\n",
wd, wd->interval, wd->one_shot ? " one shot" : "");
wd_unlock();
ping_watchdog();
foreach_dlist(p, wd_queue) {
if (wd == p) {
wd_queue->remove(wd);
- Dmsg1(400, "Unregistered watchdog %p\n", wd);
+ Dmsg1(800, "Unregistered watchdog %p\n", wd);
ok = true;
goto get_out;
}
foreach_dlist(p, wd_inactive) {
if (wd == p) {
wd_inactive->remove(wd);
- Dmsg1(400, "Unregistered inactive watchdog %p\n", wd);
+ Dmsg1(800, "Unregistered inactive watchdog %p\n", wd);
ok = true;
goto get_out;
}
}
- Dmsg1(400, "Failed to unregister watchdog %p\n", wd);
+ Dmsg1(800, "Failed to unregister watchdog %p\n", wd);
get_out:
wd_unlock();
struct timezone tz;
time_t next_time;
- Dmsg0(400, "NicB-reworked watchdog thread entered\n");
+ Dmsg0(800, "NicB-reworked watchdog thread entered\n");
while (!quit) {
- watchdog_t *p;
+ watchdog_t *p;
- /*
+ /*
* We lock the jcr chain here because a good number of the
* callback routines lock the jcr chain. We need to lock
* it here *before* the watchdog lock because the SD message
} else {
p->next_fire = watchdog_time + p->interval;
}
- }
+ }
if (p->next_fire < next_time) {
next_time = p->next_fire;
}
wd_unlock();
unlock_jcr_chain();
- /*
- * Wait sleep time or until someone wakes us
+ /*
+ * Wait sleep time or until someone wakes us
*/
gettimeofday(&tv, &tz);
timeout.tv_nsec = tv.tv_usec * 1000;
V(timer_mutex);
}
- Dmsg0(400, "NicB-reworked watchdog thread exited\n");
+ Dmsg0(800, "NicB-reworked watchdog thread exited\n");
return NULL;
}
Emsg1(M_ABORT, 0, "rwl_writelock failure. ERR=%s\n",
strerror(errstat));
}
-}
+}
/*
* Unlock the watchdog. This can be called multiple times by the
Emsg1(M_ABORT, 0, "rwl_writeunlock failure. ERR=%s\n",
strerror(errstat));
}
-}
+}
/* Forward referenced functions */
extern "C" void *workq_server(void *arg);
-/*
+/*
* Initialize a work queue
*
* Returns: 0 on success
int workq_init(workq_t *wq, int threads, void *(*engine)(void *arg))
{
int stat;
-
+
if ((stat = pthread_attr_init(&wq->attr)) != 0) {
return stat;
}
wq->num_workers = 0; /* no threads yet */
wq->idle_workers = 0; /* no idle threads */
wq->engine = engine; /* routine to run */
- wq->valid = WORKQ_VALID;
+ wq->valid = WORKQ_VALID;
return 0;
}
}
wq->valid = 0; /* prevent any more operations */
- /*
- * If any threads are active, wake them
+ /*
+ * If any threads are active, wake them
*/
if (wq->num_workers > 0) {
wq->quit = 1;
/*
* Add work to a queue
* wq is a queue that was created with workq_init
- * element is a user unique item that will be passed to the
+ * element is a user unique item that will be passed to the
* processing routine
* work_item will get internal work queue item -- if it is not NULL
* priority if non-zero will cause the item to be placed on the
int stat;
workq_ele_t *item;
pthread_t id;
-
- Dmsg0(400, "workq_add\n");
+
+ Dmsg0(1400, "workq_add\n");
if (wq->valid != WORKQ_VALID) {
return EINVAL;
}
return stat;
}
- Dmsg0(400, "add item to queue\n");
+ Dmsg0(1400, "add item to queue\n");
if (priority) {
/* Add to head of queue */
if (wq->first == NULL) {
/* if any threads are idle, wake one */
if (wq->idle_workers > 0) {
- Dmsg0(400, "Signal worker\n");
+ Dmsg0(1400, "Signal worker\n");
if ((stat = pthread_cond_signal(&wq->work)) != 0) {
pthread_mutex_unlock(&wq->mutex);
return stat;
}
} else if (wq->num_workers < wq->max_workers) {
- Dmsg0(400, "Create worker thread\n");
+ Dmsg0(1400, "Create worker thread\n");
/* No idle threads so create a new one */
set_thread_concurrency(wq->max_workers + 1);
if ((stat = pthread_create(&id, &wq->attr, workq_server, (void *)wq)) != 0) {
wq->num_workers++;
}
pthread_mutex_unlock(&wq->mutex);
- Dmsg0(400, "Return workq_add\n");
+ Dmsg0(1400, "Return workq_add\n");
/* Return work_item if requested */
if (work_item) {
*work_item = item;
int stat, found = 0;
pthread_t id;
workq_ele_t *item, *prev;
-
- Dmsg0(400, "workq_remove\n");
+
+ Dmsg0(1400, "workq_remove\n");
if (wq->valid != WORKQ_VALID) {
return EINVAL;
}
if (!found) {
return EINVAL;
}
-
+
/* Move item to be first on list */
if (wq->first != work_item) {
- prev->next = work_item->next;
+ prev->next = work_item->next;
if (wq->last == work_item) {
wq->last = prev;
}
/* if any threads are idle, wake one */
if (wq->idle_workers > 0) {
- Dmsg0(400, "Signal worker\n");
+ Dmsg0(1400, "Signal worker\n");
if ((stat = pthread_cond_signal(&wq->work)) != 0) {
pthread_mutex_unlock(&wq->mutex);
return stat;
}
} else {
- Dmsg0(400, "Create worker thread\n");
+ Dmsg0(1400, "Create worker thread\n");
/* No idle threads so create a new one */
set_thread_concurrency(wq->max_workers + 1);
if ((stat = pthread_create(&id, &wq->attr, workq_server, (void *)wq)) != 0) {
wq->num_workers++;
}
pthread_mutex_unlock(&wq->mutex);
- Dmsg0(400, "Return workq_remove\n");
+ Dmsg0(1400, "Return workq_remove\n");
return stat;
}
-/*
+/*
* This is the worker thread that serves the work queue.
* In due course, it will call the user's engine.
*/
workq_ele_t *we;
int stat, timedout;
- Dmsg0(400, "Start workq_server\n");
+ Dmsg0(1400, "Start workq_server\n");
if ((stat = pthread_mutex_lock(&wq->mutex)) != 0) {
return NULL;
}
struct timeval tv;
struct timezone tz;
- Dmsg0(400, "Top of for loop\n");
+ Dmsg0(1400, "Top of for loop\n");
timedout = 0;
- Dmsg0(400, "gettimeofday()\n");
+ Dmsg0(1400, "gettimeofday()\n");
gettimeofday(&tv, &tz);
timeout.tv_nsec = 0;
timeout.tv_sec = tv.tv_sec + 2;
/*
* Wait 2 seconds, then if no more work, exit
*/
- Dmsg0(400, "pthread_cond_timedwait()\n");
+ Dmsg0(1400, "pthread_cond_timedwait()\n");
#ifdef xxxxxxxxxxxxxxxx_was_HAVE_CYGWIN
/* CYGWIN dies with a page fault the second
* time that pthread_cond_timedwait() is called
#else
stat = pthread_cond_timedwait(&wq->work, &wq->mutex, &timeout);
#endif
- Dmsg1(400, "timedwait=%d\n", stat);
+ Dmsg1(1400, "timedwait=%d\n", stat);
if (stat == ETIMEDOUT) {
timedout = 1;
break;
} else if (stat != 0) {
/* This shouldn't happen */
- Dmsg0(400, "This shouldn't happen\n");
+ Dmsg0(1400, "This shouldn't happen\n");
wq->num_workers--;
pthread_mutex_unlock(&wq->mutex);
return NULL;
}
- }
+ }
we = wq->first;
if (we != NULL) {
wq->first = we->next;
return NULL;
}
/* Call user's routine here */
- Dmsg0(400, "Calling user engine.\n");
+ Dmsg0(1400, "Calling user engine.\n");
wq->engine(we->data);
- Dmsg0(400, "Back from user engine.\n");
+ Dmsg0(1400, "Back from user engine.\n");
free(we); /* release work entry */
- Dmsg0(400, "relock mutex\n");
+ Dmsg0(1400, "relock mutex\n");
if ((stat = pthread_mutex_lock(&wq->mutex)) != 0) {
return NULL;
}
- Dmsg0(400, "Done lock mutex\n");
+ Dmsg0(1400, "Done lock mutex\n");
}
/*
* If no more work request, and we are asked to quit, then do it
if (wq->first == NULL && wq->quit) {
wq->num_workers--;
if (wq->num_workers == 0) {
- Dmsg0(400, "Wake up destroy routine\n");
+ Dmsg0(1400, "Wake up destroy routine\n");
/* Wake up destroy routine if he is waiting */
pthread_cond_broadcast(&wq->work);
}
- Dmsg0(400, "Unlock mutex\n");
+ Dmsg0(1400, "Unlock mutex\n");
pthread_mutex_unlock(&wq->mutex);
- Dmsg0(400, "Return from workq_server\n");
+ Dmsg0(1400, "Return from workq_server\n");
return NULL;
}
- Dmsg0(400, "Check for work request\n");
- /*
+ Dmsg0(1400, "Check for work request\n");
+ /*
* If no more work requests, and we waited long enough, quit
*/
- Dmsg1(400, "wq->first==NULL = %d\n", wq->first==NULL);
- Dmsg1(400, "timedout=%d\n", timedout);
+ Dmsg1(1400, "wq->first==NULL = %d\n", wq->first==NULL);
+ Dmsg1(1400, "timedout=%d\n", timedout);
if (wq->first == NULL && timedout) {
- Dmsg0(400, "break big loop\n");
+ Dmsg0(1400, "break big loop\n");
wq->num_workers--;
break;
}
- Dmsg0(400, "Loop again\n");
+ Dmsg0(1400, "Loop again\n");
} /* end of big for loop */
- Dmsg0(400, "unlock mutex\n");
+ Dmsg0(1400, "unlock mutex\n");
pthread_mutex_unlock(&wq->mutex);
- Dmsg0(400, "End workq_server\n");
+ Dmsg0(1400, "End workq_server\n");
return NULL;
}
}
dcr->jcr = jcr;
dcr->dev = dev;
+ if (dev) {
+ dcr->device = dev->device;
+ }
dcr->block = new_block(dev);
dcr->rec = new_record();
dcr->spool_fd = -1;
DEVICE *dev = dcr->dev;
lock_device(dev);
Dmsg1(100, "release_device device is %s\n", dev_is_tape(dev)?"tape":"disk");
- if (dev_state(dev, ST_READ)) {
- dev->state &= ~ST_READ; /* clear read bit */
+ if (dev->can_read()) {
+ dev->clear_read(); /* clear read bit */
if (!dev_is_tape(dev) || !dev_cap(dev, CAP_ALWAYSOPEN)) {
offline_or_rewind_dev(dev);
close_dev(dev);
} else if (dev->num_writers > 0) {
dev->num_writers--;
Dmsg1(100, "There are %d writers in release_device\n", dev->num_writers);
- if (dev_state(dev, ST_LABEL)) {
+ if (dev->is_labeled()) {
Dmsg0(100, "dir_create_jobmedia_record. Release\n");
if (!dir_create_jobmedia_record(dcr)) {
Jmsg(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
" FirstIndex=%u LastIndex=%u StartFile=%u EndFile=%u"
" StartBlock=%u EndBlock=%u\n";
static char FileAttributes[] = "UpdCat Job=%s FileAttributes ";
-static char Job_status[] = "3012 Job %s jobstatus %d\n";
+static char Job_status[] = "Status Job=%s JobStatus=%d\n";
/* Responses received from the Director */
* Kern Sibbald, October 2000
*
* Version $Id$
- *
+ *
*/
/*
Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
MA 02111-1307, USA.
*/
-
+
#include "bacula.h"
#include "stored.h"
static char OK_hello[] = "3000 OK Hello\n";
-/*********************************************************************
+/*********************************************************************
*
*
*/
return 0;
}
if (bs->msglen < 25 || bs->msglen > 200) {
- Dmsg2(50, _("Bad Hello command from Director at %s. Len=%d.\n"),
+ Dmsg2(50, _("Bad Hello command from Director at %s. Len=%d.\n"),
bs->who, bs->msglen);
- Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s. Len=%d.\n"),
+ Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s. Len=%d.\n"),
bs->who, bs->msglen);
return 0;
}
if (sscanf(bs->msg, "Hello Director %127s calling\n", dirname) != 1) {
bs->msg[100] = 0;
- Dmsg2(50, _("Bad Hello command from Director at %s: %s\n"),
+ Dmsg2(50, _("Bad Hello command from Director at %s: %s\n"),
bs->who, bs->msg);
- Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s: %s\n"),
+ Emsg2(M_FATAL, 0, _("Bad Hello command from Director at %s: %s\n"),
bs->who, bs->msg);
return 0;
}
director = NULL;
unbash_spaces(dirname);
LockRes();
- while ((director=(DIRRES *)GetNextRes(rcode, (RES *)director))) {
+ foreach_res(director, rcode) {
if (strcmp(director->hdr.name, dirname) == 0)
break;
}
UnlockRes();
if (!director) {
- Dmsg2(50, _("Connection from unknown Director %s at %s rejected.\n"),
+ Dmsg2(50, _("Connection from unknown Director %s at %s rejected.\n"),
dirname, bs->who);
- Emsg2(M_FATAL, 0, _("Connection from unknown Director %s at %s rejected.\n"
- "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"),
+ Emsg2(M_FATAL, 0, _("Connection from unknown Director %s at %s rejected.\n"
+ "Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"),
dirname, bs->who);
free_pool_memory(dirname);
return 0;
if (auth) {
get_auth = cram_md5_get_auth(bs, director->password, ssl_need);
if (!get_auth) {
- Dmsg1(50, "cram_get_auth failed with %s\n", bs->who);
+ Dmsg1(50, "cram_get_auth failed with %s\n", bs->who);
}
} else {
Dmsg1(50, "cram_auth failed with %s\n", bs->who);
}
if (!auth || !get_auth) {
stop_bsock_timer(tid);
- Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"
+ Emsg0(M_FATAL, 0, _("Incorrect password given by Director.\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
free_pool_memory(dirname);
return 0;
/*
* Inititiate the message channel with the Director.
* He has made a connection to our server.
- *
+ *
* Basic tasks done here:
* Assume the Hello message is already in the input
* buffer. We then authenticate him.
if (auth) {
get_auth = cram_md5_get_auth(fd, jcr->sd_auth_key, ssl_need);
if (!get_auth) {
- Dmsg1(50, "cram-get-auth failed with %s\n", fd->who);
+ Dmsg1(50, "cram-get-auth failed with %s\n", fd->who);
}
} else {
Dmsg1(50, "cram-auth failed with %s\n", fd->who);
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static void usage()
{
fprintf(stderr,
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
" -b <file> specify a bootstrap file\n"
int main (int argc, char *argv[])
{
- int ch;
+ int ch;
FILE *fd;
char line[1000];
- int got_inc = FALSE;
+ bool got_inc = false;
working_directory = "/tmp";
my_name_is(argc, argv, "bextract");
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0)
- debug_level = 1;
+ debug_level = 1;
break;
case 'e': /* exclude list */
add_fname_to_include_list(ff, 0, line);
}
fclose(fd);
- got_inc = TRUE;
+ got_inc = true;
break;
case 'p':
read_records(dcr, record_cb, mount_next_read_volume);
/* If output file is still open, it was the last one in the
- * archive since we just hit an end of file, so close the file.
+ * archive since we just hit an end of file, so close the file.
*/
if (is_bopen(&bfd)) {
set_attributes(jcr, attr, &bfd);
switch (rec->Stream) {
case STREAM_UNIX_ATTRIBUTES:
- case STREAM_UNIX_ATTRIBUTES_EX:
+ case STREAM_UNIX_ATTRIBUTES_EX:
/* If extracting, it was from previous stream, so
* close the output file.
Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
rec->FileIndex, attr->file_index);
}
-
+
if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
build_attr_output_fnames(jcr, attr);
extract = false;
- stat = create_file(jcr, attr, &bfd, REPLACE_ALWAYS);
+ stat = create_file(jcr, attr, &bfd, REPLACE_ALWAYS);
switch (stat) {
case CF_ERROR:
case CF_SKIP:
num_files++;
fileAddr = 0;
break;
- }
+ }
}
break;
/* Data stream and extracting */
case STREAM_FILE_DATA:
case STREAM_SPARSE_DATA:
- case STREAM_WIN32_DATA:
+ case STREAM_WIN32_DATA:
if (extract) {
if (rec->Stream == STREAM_SPARSE_DATA) {
fileAddr = faddr;
if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
berrno be;
- Emsg2(M_ERROR_TERM, 0, _("Seek error on %s: %s\n"),
+ Emsg2(M_ERROR_TERM, 0, _("Seek error on %s: %s\n"),
attr->ofname, be.strerror());
}
}
Dmsg2(8, "Write %u bytes, total=%u\n", wsize, total);
if ((uint32_t)bwrite(&bfd, wbuf, wsize) != wsize) {
berrno be;
- Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"),
+ Emsg2(M_ERROR_TERM, 0, _("Write error on %s: %s\n"),
attr->ofname, be.strerror());
}
fileAddr += wsize;
/* GZIP data stream */
case STREAM_GZIP_DATA:
- case STREAM_SPARSE_GZIP_DATA:
- case STREAM_WIN32_GZIP_DATA:
+ case STREAM_SPARSE_GZIP_DATA:
+ case STREAM_WIN32_GZIP_DATA:
#ifdef HAVE_LIBZ
if (extract) {
uLong compress_len;
fileAddr = faddr;
if (blseek(&bfd, (off_t)fileAddr, SEEK_SET) < 0) {
berrno be;
- Emsg3(M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
+ Emsg3(M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
edit_uint64(fileAddr, ec1), attr->ofname, be.strerror());
extract = false;
return true;
wsize = rec->data_len;
}
compress_len = compress_buf_size;
- if ((stat=uncompress((Bytef *)compress_buf, &compress_len,
+ if ((stat=uncompress((Bytef *)compress_buf, &compress_len,
(const Bytef *)wbuf, (uLong)wsize) != Z_OK)) {
Emsg1(M_ERROR, 0, _("Uncompression error. ERR=%d\n"), stat);
extract = false;
if ((uLongf)bwrite(&bfd, compress_buf, (size_t)compress_len) != compress_len) {
berrno be;
Pmsg0(0, "===Write error===\n");
- Emsg2(M_ERROR, 0, _("Write error on %s: %s\n"),
+ Emsg2(M_ERROR, 0, _("Write error on %s: %s\n"),
attr->ofname, be.strerror());
extract = false;
return true;
set_attributes(jcr, attr, &bfd);
extract = false;
}
- Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"),
+ Jmsg(jcr, M_ERROR, 0, _("Unknown stream=%d ignored. This shouldn't happen!\n"),
rec->Stream);
break;
-
+
} /* end switch */
return true;
}
DEVICE *dev = dcr->dev;
fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
dcr->VolumeName, dev_name(dev));
- getchar();
+ getchar();
return true;
}
* Note, when written, it is serialized.
uint32_t CheckSum;
- uint32_t block_len;
+ uint32_t block_len;
uint32_t BlockNumber;
char Id[BLKHDR_ID_LENGTH];
uint32_t VolSessionTime;
*/
+class DEVICE; /* for forward reference */
+
/*
* DEV_BLOCK for reading and writing blocks.
* This is the basic unit that is written to the device, and
*/
struct DEV_BLOCK {
DEV_BLOCK *next; /* pointer to next one */
- void *dev; /* pointer to device (DEVICE not defined yet) */
+ DEVICE *dev; /* pointer to device */
/* binbuf is the number of bytes remaining in the buffer.
* For writes, it is bytes not yet written.
* For reads, it is remaining bytes not yet read.
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static void usage()
{
fprintf(stderr,
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bls [-d debug_level] <physical-device-name>\n"
+"Usage: bls [options] <device-name>\n"
" -b <file> specify a bootstrap file\n"
" -c <file> specify a config file\n"
" -d <level> specify debug level\n"
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0)
- debug_level = 1;
+ debug_level = 1;
break;
case 'e': /* exclude list */
if (bsrName) {
bsr = parse_bsr(NULL, bsrName);
}
- jcr = setup_jcr("bls", argv[i], bsr, VolumeName, 1); /* acquire for read */
+ jcr = setup_jcr("bls", argv[i], bsr, VolumeName, 1); /* acquire for read */
if (!jcr) {
exit(1);
}
attr = new_attr();
/*
* Assume that we have already read the volume label.
- * If on second or subsequent volume, adjust buffer pointer
+ * If on second or subsequent volume, adjust buffer pointer
*/
if (dev->VolHdr.PrevVolName[0] != 0) { /* second volume */
- Pmsg1(0, "\n\
-Warning, this Volume is a continuation of Volume %s\n",
+ Pmsg1(0, "\n"
+"Warning, this Volume is a continuation of Volume %s\n",
dev->VolHdr.PrevVolName);
}
/* List just block information */
static void do_blocks(char *infname)
{
- if (verbose) {
- dump_volume_label(dev);
- rec = new_record();
- }
for ( ;; ) {
if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) {
- Dmsg1(100, "!read_block(): ERR=%s\n", strerror_dev(dev));
- if (dev->state & ST_EOT) {
+ Dmsg1(100, "!read_block(): ERR=%s\n", dev->strerror());
+ if (dev->at_eot()) {
if (!mount_next_read_volume(dcr)) {
- Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"),
+ Jmsg(jcr, M_INFO, 0, _("Got EOM at file %u on device %s, Volume \"%s\"\n"),
dev->file, dev_name(dev), dcr->VolumeName);
break;
}
get_session_record(dev, record, &sessrec);
free_record(record);
Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), dcr->VolumeName);
-
- } else if (dev->state & ST_EOF) {
- Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
+ } else if (dev->at_eof()) {
+ Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"),
dev->file, dev_name(dev), dcr->VolumeName);
Dmsg0(20, "read_record got eof. try again\n");
continue;
return true;
}
/* File Attributes stream */
- if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
+ if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
- if (verbose > 1) {
- const char *rtype = "Attributes";
- Pmsg5(-1, "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n",
- rtype, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
- }
if (!unpack_attributes_record(jcr, rec->Stream, rec->data, attr)) {
if (!forge_on) {
Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
build_attr_output_fnames(jcr, attr);
if (file_is_included(&ff, attr->fname) && !file_is_excluded(&ff, attr->fname)) {
+ if (verbose) {
+ Pmsg5(-1, "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n",
+ rec->FileIndex, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
+ }
print_ls_output(jcr, attr);
num_files++;
}
memset(sessrec, 0, sizeof(sessrec));
switch (rec->FileIndex) {
case PRE_LABEL:
- rtype = "Fresh Volume Label";
+ rtype = "Fresh Volume Label";
break;
case VOL_LABEL:
rtype = "Volume Label";
DEVICE *dev = dcr->dev;
fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
dcr->VolumeName, dev_name(dev));
- getchar();
+ getchar();
return true;
}
/* Forward referenced functions */
static void do_scan(void);
static bool record_cb(DCR *dcr, DEV_RECORD *rec);
-static int create_file_attributes_record(B_DB *db, JCR *mjcr,
+static int create_file_attributes_record(B_DB *db, JCR *mjcr,
char *fname, char *lname, int type,
char *ap, DEV_RECORD *rec);
static int create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl);
static bool update_media_record(B_DB *db, MEDIA_DBR *mr);
static int create_pool_record(B_DB *db, POOL_DBR *pr);
static JCR *create_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *label, DEV_RECORD *rec);
-static int update_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *elabel,
+static int update_job_record(B_DB *db, JOB_DBR *mr, SESSION_LABEL *elabel,
DEV_RECORD *rec);
static int create_client_record(B_DB *db, CLIENT_DBR *cr);
static int create_fileset_record(B_DB *db, FILESET_DBR *fsr);
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0)
- debug_level = 1;
+ debug_level = 1;
break;
case 'h':
default:
usage();
- }
+ }
}
argc -= optind;
argv += optind;
me = (STORES *)GetNextRes(R_STORAGE, NULL);
if (!me) {
UnlockRes();
- Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
+ Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
configfile);
}
UnlockRes();
/* Check if -w option given, otherwise use resource for working directory */
- if (wd) {
+ if (wd) {
working_directory = wd;
} else if (!me->working_directory) {
Emsg1(M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
}
bjcr = setup_jcr("bscan", argv[0], bsr, VolumeName, 1); /* read device */
- if (!bjcr) {
+ if (!bjcr) {
exit(1);
}
dev = bjcr->dcr->dev;
Pmsg1(000, _("Current Volume Size = %" llu "\n"), currentVolumeSize);
}
- if ((db=db_init_database(NULL, db_name, db_user, db_password,
+ if ((db=db_init_database(NULL, db_name, db_user, db_password,
db_host, 0, NULL, 0)) == NULL) {
Emsg0(M_ERROR_TERM, 0, _("Could not init Bacula database\n"));
}
term_dev(dev);
return 0;
}
-
-/*
+
+/*
* We are at the end of reading a tape. Now, we simulate handling
* the end of writing a tape by wiffling through the attached
* jcrs creating jobmedia records.
continue;
}
if (verbose) {
- Pmsg1(000, _("Create JobMedia for Job %s\n"), mjcr->Job);
+ Pmsg1(000, _("Create JobMedia for Job %s\n"), mjcr->Job);
}
if (dev->state & ST_TAPE) {
mdcr->EndBlock = dev->EndBlock;
mdcr->EndFile = (uint32_t)(dev->file_addr >> 32);
}
if (!create_jobmedia_record(db, mjcr)) {
- Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
+ Pmsg2(000, _("Could not create JobMedia record for Volume=%s Job=%s\n"),
dev->VolCatInfo.VolCatName, mjcr->Job);
}
- }
+ }
/* Now let common read routine get up next tape. Note,
* we call mount_next... with bscan's jcr because that is where we
* have the Volume list, but we get attached.
return stat;
}
-static void do_scan()
+static void do_scan()
{
attr = new_attr();
if (showProgress) {
int64_t pct = (mr.VolBytes * 100) / currentVolumeSize;
if (pct != last_pct) {
- fprintf(stdout, "done: %" lld "\n", pct);
+ fprintf(stdout, "done: %" lld "\n", pct);
fflush(stdout);
last_pct = pct;
}
}
}
-
+
if (list_records) {
Pmsg5(000, _("Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n"),
- rec->VolSessionId, rec->VolSessionTime, rec->FileIndex,
+ rec->VolSessionId, rec->VolSessionTime, rec->FileIndex,
rec->Stream, rec->data_len);
}
- /*
- * Check for Start or End of Session Record
+ /*
+ * Check for Start or End of Session Record
*
*/
if (rec->FileIndex < 0) {
}
switch (rec->FileIndex) {
case PRE_LABEL:
- Pmsg0(000, _("Volume is prelabeled. This tape cannot be scanned.\n"));
+ Pmsg0(000, _("Volume is prelabeled. This tape cannot be scanned.\n"));
return false;
break;
num_pools++;
if (db_get_pool_record(bjcr, db, &pr)) {
if (verbose) {
- Pmsg1(000, _("Pool record for %s found in DB.\n"), pr.Name);
+ Pmsg1(000, _("Pool record for %s found in DB.\n"), pr.Name);
}
} else {
if (!update_db) {
- Pmsg1(000, _("VOL_LABEL: Pool record not found for Pool: %s\n"),
+ Pmsg1(000, _("VOL_LABEL: Pool record not found for Pool: %s\n"),
pr.Name);
}
create_pool_record(db, &pr);
}
if (strcmp(pr.PoolType, dev->VolHdr.PoolType) != 0) {
- Pmsg2(000, _("VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n"),
+ Pmsg2(000, _("VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n"),
pr.PoolType, dev->VolHdr.PoolType);
return true;
} else if (verbose) {
- Pmsg1(000, _("Pool type \"%s\" is OK.\n"), pr.PoolType);
+ Pmsg1(000, _("Pool type \"%s\" is OK.\n"), pr.PoolType);
}
/* Check Media Info */
num_media++;
if (db_get_media_record(bjcr, db, &mr)) {
if (verbose) {
- Pmsg1(000, _("Media record for %s found in DB.\n"), mr.VolumeName);
+ Pmsg1(000, _("Media record for %s found in DB.\n"), mr.VolumeName);
}
/* Clear out some volume statistics that will be updated */
mr.VolJobs = mr.VolFiles = mr.VolBlocks = 0;
mr.VolBytes = rec->data_len + 20;
} else {
if (!update_db) {
- Pmsg1(000, _("VOL_LABEL: Media record not found for Volume: %s\n"),
+ Pmsg1(000, _("VOL_LABEL: Media record not found for Volume: %s\n"),
mr.VolumeName);
}
bstrncpy(mr.MediaType, dev->VolHdr.MediaType, sizeof(mr.MediaType));
create_media_record(db, &mr, &dev->VolHdr);
}
if (strcmp(mr.MediaType, dev->VolHdr.MediaType) != 0) {
- Pmsg2(000, _("VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n"),
+ Pmsg2(000, _("VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n"),
mr.MediaType, dev->VolHdr.MediaType);
return true; /* ignore error */
} else if (verbose) {
- Pmsg1(000, _("Media type \"%s\" is OK.\n"), mr.MediaType);
+ Pmsg1(000, _("Media type \"%s\" is OK.\n"), mr.MediaType);
}
/* Reset some JCR variables */
foreach_dlist(dcr, dev->attached_dcrs) {
dcr->StartFile = dcr->EndFile = 0;
}
- Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName);
+ Pmsg1(000, _("VOL_LABEL: OK for Volume: %s\n"), mr.VolumeName);
break;
case SOS_LABEL:
mr.VolJobs++;
num_jobs++;
if (ignored_msgs > 0) {
- Pmsg1(000, _("%d \"errors\" ignored before first Start of Session record.\n"),
+ Pmsg1(000, _("%d \"errors\" ignored before first Start of Session record.\n"),
ignored_msgs);
ignored_msgs = 0;
}
bstrncpy(jr.Job, label.Job, sizeof(jr.Job));
if (db_get_job_record(bjcr, db, &jr)) {
/* Job record already exists in DB */
- update_db = false; /* don't change db in create_job_record */
+ update_db = false; /* don't change db in create_job_record */
if (verbose) {
- Pmsg1(000, _("SOS_LABEL: Found Job record for JobId: %d\n"), jr.JobId);
+ Pmsg1(000, _("SOS_LABEL: Found Job record for JobId: %d\n"), jr.JobId);
}
} else {
/* Must create a Job record in DB */
if (!update_db) {
- Pmsg1(000, _("SOS_LABEL: Job record not found for JobId: %d\n"),
+ Pmsg1(000, _("SOS_LABEL: Job record not found for JobId: %d\n"),
jr.JobId);
}
}
create_client_record(db, &cr);
jr.ClientId = cr.ClientId;
- /* process label, if Job record exists don't update db */
+ /* process label, if Job record exists don't update db */
mjcr = create_job_record(db, &jr, &label, rec);
dcr = mjcr->dcr;
update_db = save_update_db;
if (dev->state & ST_TAPE) {
/*
* Note, we have already advanced past current block,
- * so the correct number is block_num - 1
- */
+ * so the correct number is block_num - 1
+ */
dcr->StartBlock = dev->block_num - 1;
dcr->StartFile = dev->file;
} else {
bstrncpy(dcr->pool_name, label.PoolName, sizeof(dcr->pool_name));
if (rec->VolSessionId != jr.VolSessionId) {
- Pmsg3(000, _("SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n"),
+ Pmsg3(000, _("SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n"),
jr.JobId,
jr.VolSessionId, rec->VolSessionId);
return true; /* ignore error */
}
if (rec->VolSessionTime != jr.VolSessionTime) {
- Pmsg3(000, _("SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n"),
+ Pmsg3(000, _("SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n"),
jr.JobId,
jr.VolSessionTime, rec->VolSessionTime);
return true; /* ignore error */
}
if (jr.PoolId != pr.PoolId) {
- Pmsg3(000, _("SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n"),
+ Pmsg3(000, _("SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n"),
jr.JobId,
jr.PoolId, pr.PoolId);
return true; /* ignore error */
mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
if (!mjcr) {
- Pmsg2(000, _("Could not find SessId=%d SessTime=%d for EOS record.\n"),
+ Pmsg2(000, _("Could not find SessId=%d SessTime=%d for EOS record.\n"),
rec->VolSessionId, rec->VolSessionTime);
break;
}
break;
case EOT_LABEL: /* end of all tapes */
- /*
+ /*
* Wiffle through all jobs still open and close
* them.
*/
jr.JobTDate = (utime_t)mjcr->start_time;
jr.ClientId = mjcr->ClientId;
if (!db_update_job_end_record(bjcr, db, &jr)) {
- Pmsg1(0, _("Could not update job record. ERR=%s\n"), db_strerror(db));
+ Pmsg1(0, _("Could not update job record. ERR=%s\n"), db_strerror(db));
}
mjcr->dcr = NULL;
free_jcr(mjcr);
mr.VolBytes += mr.VolBlocks * WRITE_BLKHDR_LENGTH; /* approx. */
mr.VolMounts++;
update_media_record(db, &mr);
- Pmsg3(0, _("End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n"), mr.VolFiles,
+ Pmsg3(0, _("End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n"), mr.VolFiles,
mr.VolBlocks, edit_uint64_with_commas(mr.VolBytes, ec1));
break;
default:
mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
if (!mjcr) {
if (mr.VolJobs > 0) {
- Pmsg2(000, _("Could not find Job for SessId=%d SessTime=%d record.\n"),
+ Pmsg2(000, _("Could not find Job for SessId=%d SessTime=%d record.\n"),
rec->VolSessionId, rec->VolSessionTime);
} else {
ignored_msgs++;
/* File Attributes stream */
switch (rec->Stream) {
- case STREAM_UNIX_ATTRIBUTES:
- case STREAM_UNIX_ATTRIBUTES_EX:
+ case STREAM_UNIX_ATTRIBUTES:
+ case STREAM_UNIX_ATTRIBUTES_EX:
if (!unpack_attributes_record(bjcr, rec->Stream, rec->data, attr)) {
- Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
+ Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
}
if (attr->file_index != rec->FileIndex) {
- Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
+ Emsg2(M_ERROR_TERM, 0, _("Record header file index %ld not equal record index %ld\n"),
rec->FileIndex, attr->file_index);
}
-
+
if (verbose > 1) {
decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
build_attr_output_fnames(bjcr, attr);
num_files++;
if (verbose && (num_files & 0x7FFF) == 0) {
char ed1[30], ed2[30], ed3[30], ed4[30];
- Pmsg4(000, _("%s file records. At file:blk=%s:%s bytes=%s\n"),
+ Pmsg4(000, _("%s file records. At file:blk=%s:%s bytes=%s\n"),
edit_uint64_with_commas(num_files, ed1),
edit_uint64_with_commas(rec->File, ed2),
edit_uint64_with_commas(rec->Block, ed3),
edit_uint64_with_commas(mr.VolBytes, ed4));
- }
- create_file_attributes_record(db, mjcr, attr->fname, attr->lname,
+ }
+ create_file_attributes_record(db, mjcr, attr->fname, attr->lname,
attr->type, attr->attr, rec);
free_jcr(mjcr);
break;
if (rec->Stream == STREAM_SPARSE_DATA) {
mjcr->JobBytes -= sizeof(uint64_t);
}
-
+
free_jcr(mjcr); /* done using JCR */
break;
char MD5buf[50];
bin_to_base64(MD5buf, (char *)rec->data, 16); /* encode 16 bytes */
if (verbose > 1) {
- Pmsg1(000, _("Got MD5 record: %s\n"), MD5buf);
+ Pmsg1(000, _("Got MD5 record: %s\n"), MD5buf);
}
update_SIG_record(db, MD5buf, rec, MD5_SIG);
break;
char SIGbuf[50];
bin_to_base64(SIGbuf, (char *)rec->data, 20); /* encode 20 bytes */
if (verbose > 1) {
- Pmsg1(000, _("Got SHA1 record: %s\n"), SIGbuf);
+ Pmsg1(000, _("Got SHA1 record: %s\n"), SIGbuf);
}
update_SIG_record(db, SIGbuf, rec, SHA1_SIG);
break;
case STREAM_PROGRAM_NAMES:
if (verbose) {
- Pmsg1(000, _("Got Prog Names Stream: %s\n"), rec->data);
+ Pmsg1(000, _("Got Prog Names Stream: %s\n"), rec->data);
}
break;
case STREAM_PROGRAM_DATA:
if (verbose > 1) {
- Pmsg0(000, _("Got Prog Data Stream record.\n"));
+ Pmsg0(000, _("Got Prog Data Stream record.\n"));
}
break;
default:
mjcr->FileId = ar.FileId;
if (verbose > 1) {
- Pmsg1(000, _("Created File record: %s\n"), fname);
+ Pmsg1(000, _("Created File record: %s\n"), fname);
}
return 1;
}
/*
- * Called from SOS to create a client for the current Job
+ * Called from SOS to create a client for the current Job
*/
static int create_client_record(B_DB *db, CLIENT_DBR *cr)
{
}
if (db_get_fileset_record(bjcr, db, fsr)) {
if (verbose) {
- Pmsg1(000, _("Fileset \"%s\" already exists.\n"), fsr->FileSet);
+ Pmsg1(000, _("Fileset \"%s\" already exists.\n"), fsr->FileSet);
}
} else {
if (!db_create_fileset_record(bjcr, db, fsr)) {
- Pmsg2(0, _("Could not create FileSet record \"%s\". ERR=%s\n"),
+ Pmsg2(0, _("Could not create FileSet record \"%s\". ERR=%s\n"),
fsr->FileSet, db_strerror(db));
return 0;
}
if (verbose) {
- Pmsg1(000, _("Created FileSet record \"%s\"\n"), fsr->FileSet);
+ Pmsg1(000, _("Created FileSet record \"%s\"\n"), fsr->FileSet);
}
}
return 1;
* the Job record and to update it when the Job actually
* begins running.
*/
-static JCR *create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label,
+static JCR *create_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *label,
DEV_RECORD *rec)
{
JCR *mjcr;
Pmsg1(0, _("Could not update job start record. ERR=%s\n"), db_strerror(db));
return mjcr;
}
- Pmsg2(000, _("Created new JobId=%u record for original JobId=%u\n"), jr->JobId,
+ Pmsg2(000, _("Created new JobId=%u record for original JobId=%u\n"), jr->JobId,
label->JobId);
mjcr->JobId = jr->JobId; /* set new JobId */
return mjcr;
}
-/*
- * Simulate the database call that updates the Job
+/*
+ * Simulate the database call that updates the Job
* at Job termination time.
*/
static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
free_jcr(mjcr);
return 1;
}
-
+
if (!db_update_job_end_record(bjcr, db, jr)) {
Pmsg2(0, _("Could not update JobId=%u record. ERR=%s\n"), jr->JobId, db_strerror(db));
free_jcr(mjcr);
switch (mjcr->JobStatus) {
case JS_Terminated:
- term_msg = _("Backup OK");
+ term_msg = _("Backup OK");
break;
case JS_FatalError:
case JS_ErrorTerminated:
- term_msg = _("*** Backup Error ***");
+ term_msg = _("*** Backup Error ***");
break;
case JS_Canceled:
- term_msg = _("Backup Canceled");
+ term_msg = _("Backup Canceled");
break;
default:
term_msg = term_code;
- sprintf(term_code, _("Job Termination code: %d"), mjcr->JobStatus);
+ sprintf(term_code, _("Job Termination code: %d"), mjcr->JobStatus);
break;
}
bstrftime(sdt, sizeof(sdt), mjcr->start_time);
bstrftime(edt, sizeof(edt), mjcr->end_time);
- Pmsg14(000, _("%s\n\
-JobId: %d\n\
-Job: %s\n\
-FileSet: %s\n\
-Backup Level: %s\n\
-Client: %s\n\
-Start time: %s\n\
-End time: %s\n\
-Files Written: %s\n\
-Bytes Written: %s\n\
-Volume Session Id: %d\n\
-Volume Session Time: %d\n\
-Last Volume Bytes: %s\n\
-Termination: %s\n\n"),
+ Pmsg14(000, _("%s\n"
+"JobId: %d\n"
+"Job: %s\n"
+"FileSet: %s\n"
+"Backup Level: %s\n"
+"Client: %s\n"
+"Start time: %s\n"
+"End time: %s\n"
+"Files Written: %s\n"
+"Bytes Written: %s\n"
+"Volume Session Id: %d\n"
+"Volume Session Time: %d\n"
+"Last Volume Bytes: %s\n"
+"Termination: %s\n\n"),
edt,
mjcr->JobId,
mjcr->Job,
return 0;
}
if (verbose) {
- Pmsg2(000, _("Created JobMedia record JobId %d, MediaId %d\n"),
+ Pmsg2(000, _("Created JobMedia record JobId %d, MediaId %d\n"),
jmr.JobId, jmr.MediaId);
}
return 1;
}
-/*
+/*
* Simulate the database call that updates the MD5/SHA1 record
*/
static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type)
mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
if (!mjcr) {
if (mr.VolJobs > 0) {
- Pmsg2(000, _("Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n"),
+ Pmsg2(000, _("Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n"),
rec->VolSessionId, rec->VolSessionTime);
} else {
ignored_msgs++;
free_jcr(mjcr);
return 1;
}
-
+
if (!db_add_SIG_to_file_record(bjcr, db, mjcr->FileId, SIGbuf, type)) {
Pmsg1(0, _("Could not add MD5/SHA1 to File record. ERR=%s\n"), db_strerror(db));
free_jcr(mjcr);
}
-/*
+/*
* Create a JCR as if we are really starting the job
*/
static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId)
force_close_dev(dev);
fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
dcr->VolumeName, dev_name(dev));
- getchar();
+ getchar();
return true;
}
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/*
* List of Volume names to be read by Storage daemon.
- * Formed by Storage daemon from BSR
+ * Formed by Storage daemon from BSR
*/
struct VOL_LIST {
VOL_LIST *next;
char VolumeName[MAX_NAME_LENGTH];
- int Slot;
+ char MediaType[MAX_NAME_LENGTH];
+ int Slot;
uint32_t start_file;
};
struct BSR_VOLUME {
BSR_VOLUME *next;
char VolumeName[MAX_NAME_LENGTH];
-};
+ char MediaType[MAX_NAME_LENGTH];
+};
struct BSR_CLIENT {
BSR_CLIENT *next;
char ClientName[MAX_NAME_LENGTH];
-};
+};
struct BSR_SESSID {
BSR_SESSID *next;
BSR_SESSTIME *next;
uint32_t sesstime;
bool done; /* local done */
-};
+};
struct BSR_VOLFILE {
BSR_VOLFILE *next;
uint32_t sblock; /* start block */
uint32_t eblock; /* end block */
bool done; /* local done */
-};
+};
struct BSR_FINDEX {
int32_t findex; /* start file index */
int32_t findex2; /* end file index */
bool done; /* local done */
-};
+};
struct BSR_JOBID {
BSR_JOBID *next;
uint32_t JobId;
uint32_t JobId2;
-};
+};
struct BSR_JOBTYPE {
BSR_JOBTYPE *next;
uint32_t JobType;
-};
+};
struct BSR_JOBLEVEL {
BSR_JOBLEVEL *next;
uint32_t JobLevel;
-};
+};
struct BSR_JOB {
BSR_JOB *next;
struct BSR_STREAM {
BSR_STREAM *next;
int32_t stream; /* stream desired */
-};
+};
struct BSR {
BSR *next; /* pointer to next one */
char buf[1000];
/* Sanity checks */
- if (TAPE_BSIZE % DEV_BSIZE != 0 || TAPE_BSIZE / DEV_BSIZE == 0) {
+ if (TAPE_BSIZE % B_DEV_BSIZE != 0 || TAPE_BSIZE / B_DEV_BSIZE == 0) {
Emsg2(M_ABORT, 0, "Tape block size (%d) not multiple of system size (%d)\n",
- TAPE_BSIZE, DEV_BSIZE);
+ TAPE_BSIZE, B_DEV_BSIZE);
}
if (TAPE_BSIZE != (1 << (ffs(TAPE_BSIZE)-1))) {
Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
*
* dev.c -- low level operations on device (storage device)
*
- * Kern Sibbald, MM
+ * Kern Sibbald, MM
*
* NOTE!!!! None of these routines are reentrant. You must
- * use lock_device() and unlock_device() at a higher level,
- * or use the xxx_device() equivalents. By moving the
- * thread synchronization to a higher level, we permit
+ * use lock_device() and unlock_device() at a higher level,
+ * or use the xxx_device() equivalents. By moving the
+ * thread synchronization to a higher level, we permit
* the higher level routines to "seize" the device and
- * to carry out operations without worrying about who
- * set what lock (i.e. race conditions).
+ * to carry out operations without worrying about who
+ * set what lock (i.e. race conditions).
*
* Note, this is the device dependent code, and my have
- * to be modified for each system, but is meant to
+ * to be modified for each system, but is meant to
* be as "generic" as possible.
*
* The purpose of this code is to develop a SIMPLE Storage
if (stat(device->device_name, &statp) < 0) {
berrno be;
if (dev) {
- dev->dev_errno = errno;
+ dev->dev_errno = errno;
}
Emsg2(M_FATAL, 0, "Unable to stat device %s : %s\n", device->device_name,
- be.strerror());
+ be.strerror());
return NULL;
}
tape = false;
fifo = true;
} else {
if (dev) {
- dev->dev_errno = ENODEV;
+ dev->dev_errno = ENODEV;
}
Emsg2(M_FATAL, 0, _("%s is an unknown device type. Must be tape or directory. st_mode=%x\n"),
- device->device_name, statp.st_mode);
+ device->device_name, statp.st_mode);
return NULL;
}
if (!dev) {
if (dev->max_block_size > 1000000) {
Emsg3(M_ERROR, 0, _("Block size %u on device %s is too large, using default %u\n"),
- dev->max_block_size, dev->dev_name, DEFAULT_BLOCK_SIZE);
+ dev->max_block_size, dev->dev_name, DEFAULT_BLOCK_SIZE);
dev->max_block_size = 0;
}
if (dev->max_block_size % TAPE_BSIZE != 0) {
Emsg2(M_WARNING, 0, _("Max block size %u not multiple of device %s block size.\n"),
- dev->max_block_size, dev->dev_name);
+ dev->max_block_size, dev->dev_name);
}
-
+
dev->errmsg = get_pool_memory(PM_EMSG);
*dev->errmsg = 0;
* starts and snatches up the device.
*/
if (VolName && strcmp(dev->VolCatInfo.VolCatName, VolName) != 0) {
- return -1;
+ return -1;
}
dev->use_count++;
Mmsg2(&dev->errmsg, _("WARNING!!!! device %s opened %d times!!!\n"),
- dev->dev_name, dev->use_count);
+ dev->dev_name, dev->use_count);
Emsg1(M_WARNING, 0, "%s", dev->errmsg);
return dev->fd;
}
}
Dmsg3(29, "open_dev: tape=%d dev_name=%s vol=%s\n", dev_is_tape(dev),
- dev->dev_name, dev->VolCatInfo.VolCatName);
+ dev->dev_name, dev->VolCatInfo.VolCatName);
dev->state &= ~(ST_LABEL|ST_APPEND|ST_READ|ST_EOT|ST_WEOT|ST_EOF);
dev->file_size = 0;
if (dev->state & (ST_TAPE|ST_FIFO)) {
int timeout;
Dmsg0(29, "open_dev: device is tape\n");
if (mode == OPEN_READ_WRITE) {
- dev->mode = O_RDWR | O_BINARY;
+ dev->mode = O_RDWR | O_BINARY;
} else if (mode == OPEN_READ_ONLY) {
- dev->mode = O_RDONLY | O_BINARY;
+ dev->mode = O_RDONLY | O_BINARY;
} else if (mode == OPEN_WRITE_ONLY) {
- dev->mode = O_WRONLY | O_BINARY;
+ dev->mode = O_WRONLY | O_BINARY;
} else {
Emsg0(M_ABORT, 0, _("Illegal mode given to open_dev.\n"));
}
timeout = dev->max_open_wait;
errno = 0;
if (dev->state & ST_FIFO && timeout) {
- /* Set open timer */
- dev->tid = start_thread_timer(pthread_self(), timeout);
+ /* Set open timer */
+ dev->tid = start_thread_timer(pthread_self(), timeout);
}
/* If busy retry each second for max_open_wait seconds */
while ((dev->fd = open(dev->dev_name, dev->mode, MODE_RW)) < 0) {
- berrno be;
- if (errno == EINTR || errno == EAGAIN) {
- continue;
- }
- if (errno == EBUSY && timeout-- > 0) {
+ berrno be;
+ if (errno == EINTR || errno == EAGAIN) {
+ continue;
+ }
+ if (errno == EBUSY && timeout-- > 0) {
Dmsg2(100, "Device %s busy. ERR=%s\n", dev->dev_name, be.strerror());
- bmicrosleep(1, 0);
- continue;
- }
- dev->dev_errno = errno;
+ bmicrosleep(1, 0);
+ continue;
+ }
+ dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("stored: unable to open device %s: ERR=%s\n"),
- dev->dev_name, be.strerror());
- /* Stop any open timer we set */
- if (dev->tid) {
- stop_thread_timer(dev->tid);
- dev->tid = 0;
- }
- Emsg0(M_FATAL, 0, dev->errmsg);
- break;
+ dev->dev_name, be.strerror());
+ /* Stop any open timer we set */
+ if (dev->tid) {
+ stop_thread_timer(dev->tid);
+ dev->tid = 0;
+ }
+ Emsg0(M_FATAL, 0, dev->errmsg);
+ break;
}
if (dev->fd >= 0) {
- dev->dev_errno = 0;
- dev->state |= ST_OPENED;
- dev->use_count = 1;
- update_pos_dev(dev); /* update position */
- set_os_device_parameters(dev); /* do system dependent stuff */
+ dev->dev_errno = 0;
+ dev->state |= ST_OPENED;
+ dev->use_count = 1;
+ update_pos_dev(dev); /* update position */
+ set_os_device_parameters(dev); /* do system dependent stuff */
}
/* Stop any open() timer we started */
if (dev->tid) {
- stop_thread_timer(dev->tid);
- dev->tid = 0;
+ stop_thread_timer(dev->tid);
+ dev->tid = 0;
}
Dmsg1(29, "open_dev: tape %d opened\n", dev->fd);
} else {
*/
if (VolName == NULL || *VolName == 0) {
Mmsg(dev->errmsg, _("Could not open file device %s. No Volume name given.\n"),
- dev->dev_name);
- return -1;
+ dev->dev_name);
+ return -1;
}
archive_name = get_pool_memory(PM_FNAME);
pm_strcpy(archive_name, dev->dev_name);
pm_strcat(archive_name, VolName);
Dmsg1(29, "open_dev: device is disk %s\n", archive_name);
if (mode == OPEN_READ_WRITE) {
- dev->mode = O_CREAT | O_RDWR | O_BINARY;
+ dev->mode = O_CREAT | O_RDWR | O_BINARY;
} else if (mode == OPEN_READ_ONLY) {
- dev->mode = O_RDONLY | O_BINARY;
+ dev->mode = O_RDONLY | O_BINARY;
} else if (mode == OPEN_WRITE_ONLY) {
- dev->mode = O_WRONLY | O_BINARY;
+ dev->mode = O_WRONLY | O_BINARY;
} else {
Emsg0(M_ABORT, 0, _("Illegal mode given to open_dev.\n"));
}
/* If creating file, give 0640 permissions */
if ((dev->fd = open(archive_name, dev->mode, 0640)) < 0) {
- berrno be;
- dev->dev_errno = errno;
+ berrno be;
+ dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("Could not open: %s, ERR=%s\n"), archive_name, be.strerror());
- Emsg0(M_FATAL, 0, dev->errmsg);
+ Emsg0(M_FATAL, 0, dev->errmsg);
} else {
- dev->dev_errno = 0;
- dev->state |= ST_OPENED;
- dev->use_count = 1;
- update_pos_dev(dev); /* update position */
+ dev->dev_errno = 0;
+ dev->state |= ST_OPENED;
+ dev->use_count = 1;
+ update_pos_dev(dev); /* update position */
}
Dmsg1(29, "open_dev: disk fd=%d opened\n", dev->fd);
free_pool_memory(archive_name);
/*
* Rewind the device.
* Returns: true on success
- * false on failure
+ * false on failure
*/
bool rewind_dev(DEVICE *dev)
{
if (dev->fd < 0) {
dev->dev_errno = EBADF;
Mmsg1(&dev->errmsg, _("Bad call to rewind_dev. Device %s not open\n"),
- dev->dev_name);
+ dev->dev_name);
Emsg0(M_ABORT, 0, dev->errmsg);
return false;
}
* retrying every 5 seconds.
*/
for (i=dev->max_rewind_wait; ; i -= 5) {
- if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- berrno be;
- clrerror_dev(dev, MTREW);
- if (i == dev->max_rewind_wait) {
+ if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
+ berrno be;
+ clrerror_dev(dev, MTREW);
+ if (i == dev->max_rewind_wait) {
Dmsg1(200, "Rewind error, %s. retrying ...\n", be.strerror());
- }
- if (dev->dev_errno == EIO && i > 0) {
+ }
+ if (dev->dev_errno == EIO && i > 0) {
Dmsg0(200, "Sleeping 5 seconds.\n");
- bmicrosleep(5, 0);
- continue;
- }
+ bmicrosleep(5, 0);
+ continue;
+ }
Mmsg2(&dev->errmsg, _("Rewind error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return false;
- }
- break;
+ dev->dev_name, be.strerror());
+ return false;
+ }
+ break;
}
} else if (dev->state & ST_FILE) {
if (lseek(dev->fd, (off_t)0, SEEK_SET) < 0) {
- berrno be;
- dev->dev_errno = errno;
+ berrno be;
+ dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return false;
+ dev->dev_name, be.strerror());
+ return false;
}
}
return true;
/*
* Position device to end of medium (end of data)
* Returns: 1 on succes
- * 0 on error
+ * 0 on error
*/
int
eod_dev(DEVICE *dev)
pos = lseek(dev->fd, (off_t)0, SEEK_END);
// Dmsg1(100, "====== Seek to %lld\n", pos);
if (pos >= 0) {
- update_pos_dev(dev);
- dev->state |= ST_EOT;
- return 1;
+ update_pos_dev(dev);
+ dev->state |= ST_EOT;
+ return 1;
}
dev->dev_errno = errno;
berrno be;
Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
return 0;
}
#ifdef MTEOM
struct mtget mt_stat;
Dmsg0(100,"Using FAST FSF for EOM\n");
if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno <= 0) {
- if (!rewind_dev(dev)) {
- return 0;
- }
+ if (!rewind_dev(dev)) {
+ return 0;
+ }
}
mt_com.mt_op = MTFSF;
/*
*/
mt_com.mt_count = INT16_MAX; /* use big positive number */
if (mt_com.mt_count < 0) {
- mt_com.mt_count = INT16_MAX; /* brain damaged system */
+ mt_com.mt_count = INT16_MAX; /* brain damaged system */
}
}
}
if (dev_cap(dev, CAP_FASTFSF) || dev_cap(dev, CAP_EOM)) {
if ((stat=ioctl(dev->fd, MTIOCTOP, (char *)&mt_com)) < 0) {
- berrno be;
- clrerror_dev(dev, mt_com.mt_op);
+ berrno be;
+ clrerror_dev(dev, mt_com.mt_op);
Dmsg1(50, "ioctl error: %s\n", be.strerror());
- update_pos_dev(dev);
+ update_pos_dev(dev);
Mmsg2(&dev->errmsg, _("ioctl MTEOM error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return 0;
+ dev->dev_name, be.strerror());
+ return 0;
}
if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
- berrno be;
- clrerror_dev(dev, -1);
+ berrno be;
+ clrerror_dev(dev, -1);
Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return 0;
+ dev->dev_name, be.strerror());
+ return 0;
}
Dmsg2(100, "EOD file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno);
dev->file = mt_stat.mt_fileno;
{
#endif
if (!rewind_dev(dev)) {
- return 0;
+ return 0;
}
/*
* Move file by file to the end of the tape
int file_num;
for (file_num=dev->file; !(dev->state & ST_EOT); file_num++) {
Dmsg0(200, "eod_dev: doing fsf 1\n");
- if (!fsf_dev(dev, 1)) {
+ if (!fsf_dev(dev, 1)) {
Dmsg0(200, "fsf_dev error.\n");
- return 0;
- }
- /*
- * Avoid infinite loop. ***FIXME*** possibly add code
- * to set EOD or to turn off CAP_FASTFSF if on.
- */
- if (file_num == (int)dev->file) {
- struct mtget mt_stat;
+ return 0;
+ }
+ /*
+ * Avoid infinite loop. ***FIXME*** possibly add code
+ * to set EOD or to turn off CAP_FASTFSF if on.
+ */
+ if (file_num == (int)dev->file) {
+ struct mtget mt_stat;
Dmsg1(100, "fsf_dev did not advance from file %d\n", file_num);
#ifndef HAVE_OPENBSD_OS
- if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 &&
- mt_stat.mt_fileno >= 0) {
+ if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 &&
+ mt_stat.mt_fileno >= 0) {
Dmsg2(100, "Adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno);
- dev->file = mt_stat.mt_fileno;
- }
+ dev->file = mt_stat.mt_fileno;
+ }
#endif
- stat = 0;
- break; /* we are not progressing, bail out */
- }
+ stat = 0;
+ break; /* we are not progressing, bail out */
+ }
}
}
/*
/* If BSF worked and fileno is known (not -1), set file */
if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno >= 0) {
Dmsg2(100, "BSFATEOF adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno);
- dev->file = mt_stat.mt_fileno;
+ dev->file = mt_stat.mt_fileno;
} else {
- dev->file++; /* wing it -- not correct on all OSes */
+ dev->file++; /* wing it -- not correct on all OSes */
}
} else {
- update_pos_dev(dev); /* update position */
+ update_pos_dev(dev); /* update position */
stat = 1;
}
Dmsg1(200, "EOD dev->file=%d\n", dev->file);
* Set the position of the device -- only for files
* For other devices, there is no generic way to do it.
* Returns: true on succes
- * false on error
+ * false on error
*/
bool update_pos_dev(DEVICE *dev)
{
dev->file_addr = 0;
pos = lseek(dev->fd, (off_t)0, SEEK_CUR);
if (pos < 0) {
- berrno be;
- dev->dev_errno = errno;
+ berrno be;
+ dev->dev_errno = errno;
Pmsg1(000, "Seek error: ERR=%s\n", be.strerror());
Mmsg2(&dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- ok = false;
+ dev->dev_name, be.strerror());
+ ok = false;
} else {
- dev->file_addr = pos;
+ dev->file_addr = pos;
}
}
return ok;
Dmsg0(-20," Bacula status:");
Dmsg2(-20," file=%d block=%d\n", dev->file, dev->block_num);
if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
- berrno be;
- dev->dev_errno = errno;
+ berrno be;
+ dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return 0;
+ dev->dev_name, be.strerror());
+ return 0;
}
Dmsg0(-20, " Device status:");
#if defined(HAVE_LINUX_OS)
if (GMT_EOF(mt_stat.mt_gstat)) {
- stat |= BMT_EOF;
+ stat |= BMT_EOF;
Dmsg0(-20, " EOF");
}
if (GMT_BOT(mt_stat.mt_gstat)) {
- stat |= BMT_BOT;
+ stat |= BMT_BOT;
Dmsg0(-20, " BOT");
}
if (GMT_EOT(mt_stat.mt_gstat)) {
- stat |= BMT_EOT;
+ stat |= BMT_EOT;
Dmsg0(-20, " EOT");
}
if (GMT_SM(mt_stat.mt_gstat)) {
- stat |= BMT_SM;
+ stat |= BMT_SM;
Dmsg0(-20, " SM");
}
if (GMT_EOD(mt_stat.mt_gstat)) {
- stat |= BMT_EOD;
+ stat |= BMT_EOD;
Dmsg0(-20, " EOD");
}
if (GMT_WR_PROT(mt_stat.mt_gstat)) {
- stat |= BMT_WR_PROT;
+ stat |= BMT_WR_PROT;
Dmsg0(-20, " WR_PROT");
}
if (GMT_ONLINE(mt_stat.mt_gstat)) {
- stat |= BMT_ONLINE;
+ stat |= BMT_ONLINE;
Dmsg0(-20, " ONLINE");
}
if (GMT_DR_OPEN(mt_stat.mt_gstat)) {
- stat |= BMT_DR_OPEN;
+ stat |= BMT_DR_OPEN;
Dmsg0(-20, " DR_OPEN");
}
if (GMT_IM_REP_EN(mt_stat.mt_gstat)) {
- stat |= BMT_IM_REP_EN;
+ stat |= BMT_IM_REP_EN;
Dmsg0(-20, " IM_REP_EN");
}
#endif /* !SunOS && !OSF */
/*
* Load medium in device
* Returns: true on success
- * false on failure
+ * false on failure
*/
bool load_dev(DEVICE *dev)
{
#ifndef MTLOAD
Dmsg0(200, "stored: MTLOAD command not available\n");
berrno be;
- dev->dev_errno = ENOTTY; /* function not available */
+ dev->dev_errno = ENOTTY; /* function not available */
Mmsg2(&dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
return false;
#else
berrno be;
dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
return false;
}
return true;
/*
* Rewind device and put it offline
* Returns: true on success
- * false on failure
+ * false on failure
*/
bool offline_dev(DEVICE *dev)
{
berrno be;
dev->dev_errno = errno;
Mmsg2(&dev->errmsg, _("ioctl MTOFFL error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
return false;
}
Dmsg1(100, "Offlined device %s\n", dev->dev_name);
if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
return offline_dev(dev);
} else {
- /*
+ /*
* Note, this rewind probably should not be here (it wasn't
* in prior versions of Bacula), but on FreeBSD, this is
* needed in the case the tape was "frozen" due to an error
}
/*
- * Foward space a file
+ * Foward space a file
* Returns: true on success
- * false on failure
+ * false on failure
*/
bool
fsf_dev(DEVICE *dev, int num)
mt_com.mt_count = num;
stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
if (stat < 0 || ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) {
- berrno be;
- dev->state |= ST_EOT;
+ berrno be;
+ dev->state |= ST_EOT;
Dmsg0(200, "Set ST_EOT\n");
- clrerror_dev(dev, MTFSF);
+ clrerror_dev(dev, MTFSF);
Mmsg2(dev->errmsg, _("ioctl MTFSF error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
Dmsg1(200, "%s", dev->errmsg);
- return false;
+ return false;
}
Dmsg2(200, "fsf file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno);
dev->file = mt_stat.mt_fileno;
- dev->state |= ST_EOF; /* just read EOF */
+ dev->state |= ST_EOF; /* just read EOF */
dev->file_addr = 0;
dev->file_size = 0;
return true;
int rbuf_len;
Dmsg0(200, "FSF has cap_fsf\n");
if (dev->max_block_size == 0) {
- rbuf_len = DEFAULT_BLOCK_SIZE;
+ rbuf_len = DEFAULT_BLOCK_SIZE;
} else {
- rbuf_len = dev->max_block_size;
+ rbuf_len = dev->max_block_size;
}
rbuf = get_memory(rbuf_len);
mt_com.mt_op = MTFSF;
mt_com.mt_count = 1;
while (num-- && !(dev->state & ST_EOT)) {
Dmsg0(100, "Doing read before fsf\n");
- if ((stat = read(dev->fd, (char *)rbuf, rbuf_len)) < 0) {
- if (errno == ENOMEM) { /* tape record exceeds buf len */
- stat = rbuf_len; /* This is OK */
- } else {
- berrno be;
- dev->state |= ST_EOT;
- clrerror_dev(dev, -1);
+ if ((stat = read(dev->fd, (char *)rbuf, rbuf_len)) < 0) {
+ if (errno == ENOMEM) { /* tape record exceeds buf len */
+ stat = rbuf_len; /* This is OK */
+ } else {
+ berrno be;
+ dev->state |= ST_EOT;
+ clrerror_dev(dev, -1);
Dmsg2(100, "Set ST_EOT read errno=%d. ERR=%s\n", dev->dev_errno,
- be.strerror());
+ be.strerror());
Mmsg2(dev->errmsg, _("read error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
Dmsg1(100, "%s", dev->errmsg);
- break;
- }
- }
- if (stat == 0) { /* EOF */
- update_pos_dev(dev);
+ break;
+ }
+ }
+ if (stat == 0) { /* EOF */
+ update_pos_dev(dev);
Dmsg1(100, "End of File mark from read. File=%d\n", dev->file+1);
- /* Two reads of zero means end of tape */
- if (dev->state & ST_EOF) {
- dev->state |= ST_EOT;
+ /* Two reads of zero means end of tape */
+ if (dev->state & ST_EOF) {
+ dev->state |= ST_EOT;
Dmsg0(100, "Set ST_EOT\n");
- break;
- } else {
- dev->state |= ST_EOF;
- dev->file++;
- dev->file_addr = 0;
- dev->file_size = 0;
- continue;
- }
- } else { /* Got data */
- dev->state &= ~(ST_EOF|ST_EOT);
- }
+ break;
+ } else {
+ dev->state |= ST_EOF;
+ dev->file++;
+ dev->file_addr = 0;
+ dev->file_size = 0;
+ continue;
+ }
+ } else { /* Got data */
+ dev->state &= ~(ST_EOF|ST_EOT);
+ }
Dmsg0(100, "Doing MTFSF\n");
- stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
- if (stat < 0) { /* error => EOT */
- berrno be;
- dev->state |= ST_EOT;
+ stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com);
+ if (stat < 0) { /* error => EOT */
+ berrno be;
+ dev->state |= ST_EOT;
Dmsg0(100, "Set ST_EOT\n");
- clrerror_dev(dev, MTFSF);
+ clrerror_dev(dev, MTFSF);
Mmsg2(&dev->errmsg, _("ioctl MTFSF error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
Dmsg0(100, "Got < 0 for MTFSF\n");
Dmsg1(100, "%s", dev->errmsg);
- } else {
- dev->state |= ST_EOF; /* just read EOF */
- dev->file++;
- dev->file_addr = 0;
- dev->file_size = 0;
- }
+ } else {
+ dev->state |= ST_EOF; /* just read EOF */
+ dev->file++;
+ dev->file_addr = 0;
+ dev->file_size = 0;
+ }
}
free_memory(rbuf);
} else {
Dmsg0(200, "Doing FSR for FSF\n");
while (num-- && !(dev->state & ST_EOT)) {
- fsr_dev(dev, INT32_MAX); /* returns -1 on EOF or EOT */
+ fsr_dev(dev, INT32_MAX); /* returns -1 on EOF or EOT */
}
if (dev->state & ST_EOT) {
- dev->dev_errno = 0;
+ dev->dev_errno = 0;
Mmsg1(dev->errmsg, _("Device %s at End of Tape.\n"), dev->dev_name);
- stat = -1;
+ stat = -1;
} else {
- stat = 0;
+ stat = 0;
}
}
update_pos_dev(dev);
/*
* Backward space a file
* Returns: false on failure
- * true on success
+ * true on success
*/
bool
bsf_dev(DEVICE *dev, int num)
if (!(dev_state(dev, ST_TAPE))) {
Mmsg1(dev->errmsg, _("Device %s cannot BSF because it is not a tape.\n"),
- dev->dev_name);
+ dev->dev_name);
return false;
}
Dmsg0(29, "bsf_dev\n");
berrno be;
clrerror_dev(dev, MTBSF);
Mmsg2(dev->errmsg, _("ioctl MTBSF error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
}
update_pos_dev(dev);
return stat == 0;
/*
* Foward space a record
* Returns: false on failure
- * true on success
+ * true on success
*/
bool
fsr_dev(DEVICE *dev, int num)
#ifndef HAVE_OPENBSD_OS
if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno >= 0) {
Dmsg4(100, "Adjust from %d:%d to %d:%d\n", dev->file,
- dev->block_num, mt_stat.mt_fileno, mt_stat.mt_blkno);
- dev->file = mt_stat.mt_fileno;
- dev->block_num = mt_stat.mt_blkno;
+ dev->block_num, mt_stat.mt_fileno, mt_stat.mt_blkno);
+ dev->file = mt_stat.mt_fileno;
+ dev->block_num = mt_stat.mt_blkno;
} else
#endif
{
- if (dev->state & ST_EOF) {
- dev->state |= ST_EOT;
- } else {
- dev->state |= ST_EOF; /* assume EOF */
- dev->file++;
- dev->block_num = 0;
- dev->file_addr = 0;
- dev->file_size = 0;
- }
+ if (dev->state & ST_EOF) {
+ dev->state |= ST_EOT;
+ } else {
+ dev->state |= ST_EOF; /* assume EOF */
+ dev->file++;
+ dev->block_num = 0;
+ dev->file_addr = 0;
+ dev->file_size = 0;
+ }
}
- Mmsg2(dev->errmsg, _("ioctl MTFSR error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ Mmsg3(dev->errmsg, _("ioctl MTFSR %d error on %s. ERR=%s.\n"),
+ num, dev->dev_name, be.strerror());
}
update_pos_dev(dev);
return stat == 0;
/*
* Backward space a record
* Returns: false on failure
- * true on success
+ * true on success
*/
bool
bsr_dev(DEVICE *dev, int num)
berrno be;
clrerror_dev(dev, MTBSR);
Mmsg2(dev->errmsg, _("ioctl MTBSR error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
}
update_pos_dev(dev);
return stat == 0;
/*
* Reposition the device to file, block
* Returns: false on failure
- * true on success
+ * true on success
*/
bool
reposition_dev(DEVICE *dev, uint32_t file, uint32_t block)
off_t pos = (((off_t)file)<<32) + block;
Dmsg1(100, "===== lseek to %d\n", (int)pos);
if (lseek(dev->fd, pos, SEEK_SET) == (off_t)-1) {
- berrno be;
- dev->dev_errno = errno;
+ berrno be;
+ dev->dev_errno = errno;
Mmsg2(dev->errmsg, _("lseek error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
- return false;
+ dev->dev_name, be.strerror());
+ return false;
}
dev->file = file;
dev->block_num = block;
if (file < dev->file) {
Dmsg0(100, "Rewind_dev\n");
if (!rewind_dev(dev)) {
- return false;
+ return false;
}
}
if (file > dev->file) {
Dmsg1(100, "fsf %d\n", file-dev->file);
if (!fsf_dev(dev, file-dev->file)) {
Dmsg1(100, "fsf failed! ERR=%s\n", strerror_dev(dev));
- return false;
+ return false;
}
Dmsg2(100, "wanted_file=%d at_file=%d\n", file, dev->file);
}
/*
* Write an end of file on the device
* Returns: 0 on success
- * non-zero on failure
+ * non-zero on failure
*/
int
weof_dev(DEVICE *dev, int num)
}
dev->file_size = 0;
- if (!(dev_state(dev, ST_TAPE))) {
+ if (!dev->is_tape()) {
return 0;
}
+ if (!dev->can_append()) {
+ Mmsg0(dev->errmsg, _("Attempt to WEOF on non-appendable Volume\n"));
+ Emsg0(M_FATAL, 0, dev->errmsg);
+ return -1;
+ }
+
dev->state &= ~(ST_EOT | ST_EOF); /* remove EOF/EOT flags */
Dmsg0(29, "weof_dev\n");
mt_com.mt_op = MTWEOF;
clrerror_dev(dev, MTWEOF);
if (stat == -1) {
Mmsg2(dev->errmsg, _("ioctl MTWEOF error on %s. ERR=%s.\n"),
- dev->dev_name, be.strerror());
+ dev->dev_name, be.strerror());
}
}
return stat;
const char *msg = NULL;
struct mtget mt_stat;
- dev->dev_errno = errno; /* save errno */
+ dev->dev_errno = errno; /* save errno */
if (errno == EIO) {
dev->VolCatInfo.VolCatErrors++;
}
switch (func) {
case -1:
Emsg0(M_ABORT, 0, "Got ENOTTY on read/write!\n");
- break;
+ break;
case MTWEOF:
msg = "WTWEOF";
- dev->capabilities &= ~CAP_EOF; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_EOF; /* turn off feature */
+ break;
#ifdef MTEOM
case MTEOM:
msg = "WTEOM";
- dev->capabilities &= ~CAP_EOM; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_EOM; /* turn off feature */
+ break;
#endif
case MTFSF:
msg = "MTFSF";
- dev->capabilities &= ~CAP_FSF; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_FSF; /* turn off feature */
+ break;
case MTBSF:
msg = "MTBSF";
- dev->capabilities &= ~CAP_BSF; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_BSF; /* turn off feature */
+ break;
case MTFSR:
msg = "MTFSR";
- dev->capabilities &= ~CAP_FSR; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_FSR; /* turn off feature */
+ break;
case MTBSR:
msg = "MTBSR";
- dev->capabilities &= ~CAP_BSR; /* turn off feature */
- break;
+ dev->capabilities &= ~CAP_BSR; /* turn off feature */
+ break;
default:
msg = "Unknown";
- break;
+ break;
}
if (msg != NULL) {
- dev->dev_errno = ENOSYS;
+ dev->dev_errno = ENOSYS;
Mmsg1(&dev->errmsg, _("This device does not support %s.\n"), msg);
- Emsg0(M_ERROR, 0, dev->errmsg);
+ Emsg0(M_ERROR, 0, dev->errmsg);
}
}
/* On some systems such as NetBSD, this clears all errors */
- ioctl(dev->fd, MTIOCGET, (char *)&mt_stat);
+ ioctl(dev->fd, MTIOCGET, (char *)&mt_stat);
/* Found on Linux */
#ifdef MTIOCLRERR
} else if (dev->use_count > 0) {
dev->use_count--;
}
-
+
#ifdef FULL_DEBUG
ASSERT(dev->use_count >= 0);
#endif
dev_can_write(DEVICE *dev)
{
if ((dev->state & ST_OPENED) && (dev->state & ST_APPEND) &&
- (dev->state & ST_LABEL) && !(dev->state & ST_WEOT)) {
+ (dev->state & ST_LABEL) && !(dev->state & ST_WEOT)) {
return true;
} else {
return false;
/* ******FIXME******* put these on config variables */
dev->min_wait = 60 * 60;
dev->max_wait = 24 * 60 * 60;
- dev->max_num_wait = 9; /* 5 waits =~ 1 day, then 1 day at a time */
+ dev->max_num_wait = 9; /* 5 waits =~ 1 day, then 1 day at a time */
dev->wait_sec = dev->min_wait;
dev->rem_wait_sec = dev->wait_sec;
dev->num_wait = 0;
/*
* Returns: true if time doubled
- * false if max time expired
+ * false if max time expired
*/
bool double_dev_wait_time(DEVICE *dev)
{
- dev->wait_sec *= 2; /* double wait time */
+ dev->wait_sec *= 2; /* double wait time */
if (dev->wait_sec > dev->max_wait) { /* but not longer than maxtime */
dev->wait_sec = dev->max_wait;
}
mt_com.mt_op = MTSETBLK;
mt_com.mt_count = 0;
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTSETBLK);
+ clrerror_dev(dev, MTSETBLK);
}
mt_com.mt_op = MTSETDRVBUFFER;
mt_com.mt_count = MT_ST_CLEARBOOLEANS;
if (!dev_cap(dev, CAP_TWOEOF)) {
- mt_com.mt_count |= MT_ST_TWO_FM;
+ mt_com.mt_count |= MT_ST_TWO_FM;
}
if (dev_cap(dev, CAP_EOM)) {
- mt_com.mt_count |= MT_ST_FAST_MTEOM;
+ mt_com.mt_count |= MT_ST_FAST_MTEOM;
}
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTSETBLK);
+ clrerror_dev(dev, MTSETBLK);
}
}
return;
mt_com.mt_op = MTSETBSIZ;
mt_com.mt_count = 0;
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTSETBSIZ);
+ clrerror_dev(dev, MTSETBSIZ);
}
/* Get notified at logical end of tape */
mt_com.mt_op = MTEWARN;
mt_com.mt_count = 1;
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTEWARN);
+ clrerror_dev(dev, MTEWARN);
}
}
return;
mt_com.mt_op = MTSETBSIZ;
mt_com.mt_count = 0;
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTSETBSIZ);
+ clrerror_dev(dev, MTSETBSIZ);
}
}
return;
mt_com.mt_op = MTSRSZ;
mt_com.mt_count = 0;
if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) {
- clrerror_dev(dev, MTSRSZ);
+ clrerror_dev(dev, MTSRSZ);
}
}
return;
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* #define NEW_LOCK 1 */
-#define new_lock_device(dev) _new_lock_device(__FILE__, __LINE__, (dev))
+#define new_lock_device(dev) _new_lock_device(__FILE__, __LINE__, (dev))
#define new_lock_device_state(dev,state) _new_lock_device(__FILE__, __LINE__, (dev), (state))
#define new_unlock_device(dev) _new_unlock_device(__FILE__, __LINE__, (dev))
enum {
OPEN_READ_WRITE = 0,
OPEN_READ_ONLY,
- OPEN_WRITE_ONLY
+ OPEN_WRITE_ONLY
};
/* Generic status bits returned from status_dev() */
#define CAP_TWOEOF (1<<17) /* Write two eofs for EOM */
#define CAP_CLOSEONPOLL (1<<18) /* Close device on polling */
#define CAP_POSITIONBLOCKS (1<<19) /* Use block positioning */
+#define CAP_MTIOCGET (1<<20) /* Basic support for fileno and blkno */
+#define CAP_REQMOUNT (1<<21) /* Require mount to read files back (typically: DVD) */
/* Test state */
#define dev_state(dev, st_state) ((dev)->state & (st_state))
/* Device state bits */
#define ST_OPENED (1<<0) /* set when device opened */
-#define ST_TAPE (1<<1) /* is a tape device */
+#define ST_TAPE (1<<1) /* is a tape device */
#define ST_FILE (1<<2) /* is a file device */
#define ST_FIFO (1<<3) /* is a fifo device */
-#define ST_PROG (1<<4) /* is a program device */
-#define ST_LABEL (1<<5) /* label found */
-#define ST_MALLOC (1<<6) /* dev packet malloc'ed in init_dev() */
-#define ST_APPEND (1<<7) /* ready for Bacula append */
-#define ST_READ (1<<8) /* ready for Bacula read */
-#define ST_EOT (1<<9) /* at end of tape */
-#define ST_WEOT (1<<10) /* Got EOT on write */
-#define ST_EOF (1<<11) /* Read EOF i.e. zero bytes */
-#define ST_NEXTVOL (1<<12) /* Start writing on next volume */
-#define ST_SHORT (1<<13) /* Short block read */
+#define ST_DVD (1<<4) /* is a DVD device */
+#define ST_PROG (1<<5) /* is a program device */
+#define ST_LABEL (1<<6) /* label found */
+#define ST_MALLOC (1<<7) /* dev packet malloc'ed in init_dev() */
+#define ST_APPEND (1<<8) /* ready for Bacula append */
+#define ST_READ (1<<9) /* ready for Bacula read */
+#define ST_EOT (1<<10) /* at end of tape */
+#define ST_WEOT (1<<11) /* Got EOT on write */
+#define ST_EOF (1<<12) /* Read EOF i.e. zero bytes */
+#define ST_NEXTVOL (1<<13) /* Start writing on next volume */
+#define ST_SHORT (1<<14) /* Short block read */
+#define ST_MOUNTED (1<<15) /* the device is mounted to the mount point */
/* dev_blocked states (mutually exclusive) */
enum {
BST_UNMOUNTED, /* User unmounted device */
BST_WAITING_FOR_SYSOP, /* Waiting for operator to mount tape */
BST_DOING_ACQUIRE, /* Opening/validating/moving tape */
- BST_WRITING_LABEL, /* Labeling a tape */
+ BST_WRITING_LABEL, /* Labeling a tape */
BST_UNMOUNTED_WAITING_FOR_SYSOP, /* Closed by user during mount request */
BST_MOUNT /* Mount request */
};
uint32_t VolCatFiles; /* Number of files */
uint32_t VolCatBlocks; /* Number of blocks */
uint64_t VolCatBytes; /* Number of bytes written */
+ uint32_t VolCatParts; /* Number of parts written */
uint32_t VolCatMounts; /* Number of mounts this volume */
uint32_t VolCatErrors; /* Number of errors this volume */
uint32_t VolCatWrites; /* Number of writes this volume */
uint32_t VolCatRecycles; /* Number of recycles this volume */
uint32_t EndFile; /* Last file number */
uint32_t EndBlock; /* Last block number */
+ int32_t LabelType; /* Bacula/ANSI/IBM */
int32_t Slot; /* Slot in changer */
bool InChanger; /* Set if vol in current magazine */
uint32_t VolCatMaxJobs; /* Maximum Jobs to write to volume */
uint64_t VolWriteTime; /* time spent writing this Volume */
char VolCatStatus[20]; /* Volume status */
char VolCatName[MAX_NAME_LENGTH]; /* Desired volume to mount */
-};
+};
typedef struct s_steal_lock {
/*
* Device structure definition. There is one of these for
- * each physical device. Everything here is "global" to
+ * each physical device. Everything here is "global" to
* that device and effects all jobs using the device.
*/
-struct DEVICE {
+class DEVICE {
public:
- DEVICE *next; /* pointer to next open device */
- DEVICE *prev; /* pointer to prev open device */
- JCR *attached_jcrs; /* attached JCR list */
+ DEVICE *next;
+ DEVICE *prev;
dlist *attached_dcrs; /* attached DCR list */
pthread_mutex_t mutex; /* access control */
pthread_mutex_t spool_mutex; /* mutex for updating spool_size */
int dev_prev_blocked; /* previous blocked state */
int num_waiting; /* number of threads waiting */
int num_writers; /* number of writing threads */
+ int reserved_device; /* number of device reservations */
/* New access control in process of being implemented */
brwlock_t lock; /* New mutual exclusion lock */
int state; /* state mask */
int dev_errno; /* Our own errno */
int mode; /* read/write modes */
+ int openmode; /* parameter passed to open_dev (useful to reopen the device) */
uint32_t drive_index; /* Autochanger drive index */
POOLMEM *dev_name; /* device name */
char *errmsg; /* nicely edited error message */
uint64_t max_file_size; /* max file size to put in one file on volume */
uint64_t volume_capacity; /* advisory capacity */
uint64_t max_spool_size; /* maximum spool file size */
- uint64_t spool_size; /* curren spool size */
+ uint64_t spool_size; /* current spool size */
uint32_t max_rewind_wait; /* max secs to allow for rewind */
uint32_t max_open_wait; /* max secs to allow for open */
uint32_t max_open_vols; /* max simultaneous open volumes */
+
+ uint64_t max_part_size; /* max part size */
+ uint64_t part_size; /* current part size */
+ uint32_t part; /* current part number */
+ uint64_t part_start; /* current part start address (relative to the whole volume) */
+ uint32_t num_parts; /* number of parts (total) */
+ uint64_t free_space; /* current free space on medium (without the current part) */
+ int free_space_errno; /* indicates:
+ * - free_space_errno == 0: ignore free_space.
+ * - free_space_errno < 0: an error occured.
+ * - free_space_errno > 0: free_space is valid. */
+
utime_t vol_poll_interval; /* interval between polling Vol mount */
DEVRES *device; /* pointer to Device Resource */
btimer_t *tid; /* timer id */
VOLUME_CAT_INFO VolCatInfo; /* Volume Catalog Information */
VOLUME_LABEL VolHdr; /* Actual volume label */
-
+
/* Device wait times ***FIXME*** look at durations */
char BadVolName[MAX_NAME_LENGTH]; /* Last wrong Volume mounted */
bool poll; /* set to poll Volume */
int wait_sec;
int rem_wait_sec;
int num_wait;
+
+ int is_tape() const;
+ int is_file() const;
+ int is_fifo() const;
+ int is_dvd() const;
+ int is_open() const;
+ int is_labeled() const;
+ int is_busy() const; /* either reading or writing */
+ int at_eof() const;
+ int at_eom() const;
+ int at_eot() const;
+ int can_append() const;
+ int can_read() const;
+ const char *strerror() const;
+ const char *archive_name() const;
+ void set_eof();
+ void set_eot();
+ void set_append();
+ void set_read();
+ void clear_append();
+ void clear_read();
};
+/* Note, these return int not bool! */
+inline int DEVICE::is_tape() const { return state & ST_TAPE; }
+inline int DEVICE::is_file() const { return state & ST_FILE; }
+inline int DEVICE::is_fifo() const { return state & ST_FIFO; }
+inline int DEVICE::is_dvd() const { return state & ST_DVD; }
+inline int DEVICE::is_open() const { return state & ST_OPENED; }
+inline int DEVICE::is_labeled() const { return state & ST_LABEL; }
+inline int DEVICE::is_busy() const { return state & ST_READ || num_writers; }
+inline int DEVICE::at_eof() const { return state & ST_EOF; }
+inline int DEVICE::at_eot() const { return state & ST_EOT; }
+inline int DEVICE::can_append() const { return state & ST_APPEND; }
+inline int DEVICE::can_read() const { return state & ST_READ; }
+inline void DEVICE::set_append() { state |= ST_APPEND; }
+inline void DEVICE::set_read() { state |= ST_READ; }
+inline void DEVICE::clear_append() { state &= ~ST_APPEND; }
+inline void DEVICE::clear_read() { state &= ~ST_READ; }
+inline const char *DEVICE::strerror() const { return errmsg; }
+inline const char *DEVICE::archive_name() const { return dev_name; }
+
+
/*
- * Device Context (or Control) Record.
- * There is one of these records for each Job that is using
+ * Device Context (or Control) Record.
+ * There is one of these records for each Job that is using
* the device. Items in this record are "local" to the Job and
- * do not affect other Jobs.
+ * do not affect other Jobs. Note, a job can have multiple
+ * DCRs open, each pointing to a different device.
*/
class DCR {
public:
dlink dev_link; /* link to attach to dev */
JCR *jcr; /* pointer to JCR */
DEVICE *dev; /* pointer to device */
+ DEVRES *device; /* pointer to device resource */
DEV_BLOCK *block; /* pointer to block */
DEV_RECORD *rec; /* pointer to record */
int spool_fd; /* fd if spooling */
bool NewVol; /* set if new Volume mounted */
bool WroteVol; /* set if Volume written */
bool NewFile; /* set when EOF written */
+ bool reserved_device; /* set if reserve done */
uint32_t VolFirstIndex; /* First file index this Volume */
uint32_t VolLastIndex; /* Last file index this Volume */
uint32_t FileIndex; /* Current File Index */
*
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* Responses sent to Director daemon */
static char OKjob[] = "3000 OK Job SDid=%u SDtime=%u Authorization=%s\n";
static char OK_device[] = "3000 OK use device\n";
-static char NO_device[] = "3914 Device \"%s\" not in SD Device resources.\n";
+static char NO_device[] = "3924 Device \"%s\" not in SD Device resources.\n";
+static char NOT_open[] = "3925 Device \"%s\" could not be opened or does not exist.\n";
static char BAD_use[] = "3913 Bad use command: %s\n";
static char BAD_job[] = "3915 Bad Job command: %s\n";
foreach_res(device, R_DEVICE) {
/* Find resource, and make sure we were able to open it */
if (fnmatch(dev_name.c_str(), device->hdr.name, 0) == 0 &&
- device->dev && strcmp(device->media_type, media_type.c_str()) == 0) {
+ strcmp(device->media_type, media_type.c_str()) == 0) {
const int name_len = MAX_NAME_LENGTH;
DCR *dcr;
UnlockRes();
+ if (!device->dev) {
+ Jmsg(jcr, M_FATAL, 0, _("\n"
+ " Archive \"%s\" requested by DIR could not be opened or does not exist.\n"),
+ dev_name.c_str());
+ bnet_fsend(dir, NOT_open, dev_name.c_str());
+ return false;
+ }
dcr = new_dcr(jcr, device->dev);
if (!dcr) {
+ bnet_fsend(dir, _("3926 Could not get dcr for device: %s\n"), dev_name.c_str());
return false;
}
Dmsg1(120, "Found device %s\n", device->hdr.name);
-/*
+/*
* Match Bootstrap Records (used for restores) against
* Volume Records
- *
+ *
* Kern Sibbald, June MMII
*
* Version $Id$
#include "bacula.h"
#include "stored.h"
+#ifdef HAVE_FNMATCH
#include <fnmatch.h>
+#else
+#include "lib/fnmatch.h"
+#endif
/* Forward references */
static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done);
/*********************************************************************
*
- * Do fast block rejection based on bootstrap records.
+ * Do fast block rejection based on bootstrap records.
* use_fast_rejection will be set if we have VolSessionId and VolSessTime
* in each record. When BlockVer is >= 2, we have those in the block header
* so can do fast rejection.
if (bsr) {
bsr->reposition = false;
stat = match_all(bsr, rec, volrec, sessrec, true);
- /*
+ /*
* Note, bsr->reposition is set by match_all when
* a bsr is done. We turn it off if a match was
* found or if we cannot use positioning
BSR *bsr;
BSR *found_bsr = NULL;
- if (!root_bsr || !root_bsr->use_positioning ||
+ if (!root_bsr || !root_bsr->use_positioning ||
!root_bsr->reposition || !dev_is_tape(dev)) {
Dmsg2(100, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
return NULL;
return return_bsr;
}
-/*
+/*
* Called to tell the matcher that the end of
* the current file has been reached.
* The bsr argument is not used, but is included
* for consistency with the other match calls.
- *
+ *
* Returns: true if we should reposition
* : false otherwise.
*/
return false;
}
-/*
+/*
* Match all the components of current record
* returns 1 on match
* returns 0 no match
* returns -1 no additional matches possible
*/
-static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
+static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
SESSION_LABEL *sessrec, bool done)
{
if (bsr->done) {
*/
if (!match_jobid(bsr, bsr->JobId, sessrec, 1)) {
goto no_match;
-
+
}
if (!match_job(bsr, bsr->job, sessrec, 1)) {
goto no_match;
return 0;
}
-static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done)
+static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done)
{
if (!volume) {
return 0; /* Volume must match */
if (volfile->done && done) {
bsr->done = true;
bsr->root->reposition = true;
- Dmsg2(100, "bsr done from volfile rec=%d volefile=%d\n",
+ Dmsg2(100, "bsr done from volfile rec=%d volefile=%d\n",
rec->File, volfile->efile);
}
return 0;
-/*
- * Parse a Bootstrap Records (used for restores)
- *
+/*
+ * Parse a Bootstrap Records (used for restores)
+ *
* Kern Sibbald, June MMII
*
* Version $Id$
*/
/*
- Copyright (C) 2002 Kern Sibbald and John Walker
+ Copyright (C) 2002-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
typedef BSR * (ITEM_HANDLER)(LEX *lc, BSR *bsr);
static BSR *store_vol(LEX *lc, BSR *bsr);
+static BSR *store_mediatype(LEX *lc, BSR *bsr);
static BSR *store_client(LEX *lc, BSR *bsr);
static BSR *store_job(LEX *lc, BSR *bsr);
static BSR *store_jobid(LEX *lc, BSR *bsr);
*/
struct kw_items items[] = {
{"volume", store_vol},
+ {"mediatype", store_mediatype},
{"client", store_client},
{"job", store_job},
{"jobid", store_jobid},
};
-/*
+/*
* Create a BSR record
*/
static BSR *new_bsr()
}
/*
- * Format a scanner error message
+ * Format a scanner error message
*/
static void s_err(const char *file, int line, LEX *lc, const char *msg, ...)
{
va_start(arg_ptr, msg);
bvsnprintf(buf, sizeof(buf), msg, arg_ptr);
va_end(arg_ptr);
-
+
if (jcr) {
- Jmsg(jcr, M_FATAL, 0, _("Bootstrap file error: %s\n\
- : Line %d, col %d of file %s\n%s\n"),
+ Jmsg(jcr, M_FATAL, 0, _("Bootstrap file error: %s\n"
+" : Line %d, col %d of file %s\n%s\n"),
buf, lc->line_no, lc->col_no, lc->fname, lc->line);
} else {
- e_msg(file, line, M_FATAL, 0, _("Bootstrap file error: %s\n\
- : Line %d, col %d of file %s\n%s\n"),
+ e_msg(file, line, M_FATAL, 0, _("Bootstrap file error: %s\n"
+" : Line %d, col %d of file %s\n%s\n"),
buf, lc->line_no, lc->col_no, lc->fname, lc->line);
}
}
int token, i;
BSR *root_bsr = new_bsr();
BSR *bsr = root_bsr;
-
+
Dmsg1(200, "Enter parse_bsf %s\n", fname);
lc = lex_open_file(lc, fname, s_err);
lc->caller_ctx = (void *)jcr;
int token;
BSR_VOLUME *volume;
char *p, *n;
-
+
token = lex_get_token(lc, T_STRING);
if (token == T_ERROR) {
return NULL;
bsr->next = new_bsr();
bsr = bsr->next;
}
- /* This may actually be more than one volume separated by a |
+ /* This may actually be more than one volume separated by a |
* If so, separate them.
*/
for (p=lc->str; p && *p; ) {
bsr->volume = volume;
} else {
BSR_VOLUME *bc = bsr->volume;
- for ( ;bc->next; bc=bc->next)
+ for ( ;bc->next; bc=bc->next)
{ }
bc->next = volume;
}
return bsr;
}
+/* Shove the MediaType in each Volume in the current bsr */
+static BSR *store_mediatype(LEX *lc, BSR *bsr)
+{
+ int token;
+
+ token = lex_get_token(lc, T_STRING);
+ if (token == T_ERROR) {
+ return NULL;
+ }
+ if (!bsr->volume) {
+ Emsg1(M_ERROR,0, _("MediaType %s in bsr at inappropriate place.\n"),
+ lc->str);
+ return bsr;
+ }
+ BSR_VOLUME *bv;
+ for (bv=bsr->volume; bv; bv=bv->next) {
+ bstrncpy(bv->MediaType, lc->str, sizeof(bv->MediaType));
+ }
+ return bsr;
+}
+
+
static BSR *store_client(LEX *lc, BSR *bsr)
{
int token;
BSR_CLIENT *client;
-
+
for (;;) {
token = lex_get_token(lc, T_NAME);
if (token == T_ERROR) {
bsr->client = client;
} else {
BSR_CLIENT *bc = bsr->client;
- for ( ;bc->next; bc=bc->next)
+ for ( ;bc->next; bc=bc->next)
{ }
bc->next = client;
}
{
int token;
BSR_JOB *job;
-
+
for (;;) {
token = lex_get_token(lc, T_NAME);
if (token == T_ERROR) {
/*
- * Routine to handle Volume start/end file
+ * Routine to handle Volume start/end file
*/
static BSR *store_volfile(LEX *lc, BSR *bsr)
{
/*
- * Routine to handle Volume start/end Block
+ * Routine to handle Volume start/end Block
*/
static BSR *store_volblock(LEX *lc, BSR *bsr)
{
}
/*****************************************************************
- * Routines for handling volumes
+ * Routines for handling volumes
*/
VOL_LIST *new_vol()
{
return vol;
}
-/*
+/*
* Add current volume to end of list, only if the Volume
* is not already in the list.
*
char *p, *n;
VOL_LIST *vol;
- /*
+ /*
* Build a list of volumes to be processed
*/
jcr->NumVolumes = 0;
for (bsrvol = bsr->volume; bsrvol; bsrvol=bsrvol->next) {
vol = new_vol();
bstrncpy(vol->VolumeName, bsrvol->VolumeName, sizeof(vol->VolumeName));
+ bstrncpy(vol->MediaType, bsrvol->MediaType, sizeof(vol->MediaType));
vol->start_file = sfile;
if (add_vol(jcr, vol)) {
jcr->NumVolumes++;
- Dmsg1(400, "Added volume %s\n", vol->VolumeName);
+ Dmsg2(400, "Added volume=%s mediatype=%s\n", vol->VolumeName,
+ vol->MediaType);
} else {
Dmsg1(400, "Duplicate volume %s\n", vol->VolumeName);
free((char *)vol);
}
}
} else {
- /* This is the old way -- deprecated */
+ /* This is the old way -- deprecated */
for (p = jcr->dcr->VolumeName; p && *p; ) {
n = strchr(p, '|'); /* volume name separator */
if (n) {
}
vol = new_vol();
bstrncpy(vol->VolumeName, p, sizeof(vol->VolumeName));
+ bstrncpy(vol->MediaType, jcr->dcr->media_type, sizeof(vol->MediaType));
if (add_vol(jcr, vol)) {
jcr->NumVolumes++;
} else {
* archive. It uses a callback to pass you each record in turn,
* as well as a callback for mounting the next tape. It takes
* care of reading blocks, applying the bsr, ...
+ * Note, this routine is really the heart of the restore routines,
+ * and we are *really* bit pushing here so be careful about making
+ * any modifications.
*
* Kern E. Sibbald, August MMII
*
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
recs = New(dlist(rec, &rec->link));
position_to_first_file(jcr, dev);
+ jcr->mount_next_volume = false;
for ( ; ok && !done; ) {
if (job_canceled(jcr)) {
break;
}
if (!read_block_from_device(dcr, CHECK_BLOCK_NUMBERS)) {
- if (dev_state(dev, ST_EOT)) {
+ if (dev->at_eot()) {
DEV_RECORD *trec = new_record();
-
- Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
+ Jmsg(jcr, M_INFO, 0, "End of Volume at file %u on device %s, Volume \"%s\"\n",
dev->file, dev_name(dev), dcr->VolumeName);
if (!mount_cb(dcr)) {
Jmsg(jcr, M_INFO, 0, "End of all volumes.\n");
- ok = false;
+ ok = false; /* Stop everything */
/*
* Create EOT Label so that Media record may
* be properly updated because this is the last
trec->File = dev->file;
ok = record_cb(dcr, trec);
free_record(trec);
+ if (jcr->mount_next_volume) {
+ jcr->mount_next_volume = false;
+ dev->state &= ~ST_EOT;
+ }
break;
}
+ jcr->mount_next_volume = false;
/*
* We just have a new tape up, now read the label (first record)
* and pass it off to the callback routine, then continue
/* After reading label, we must read first data block */
continue;
- } else if (dev_state(dev, ST_EOF)) {
+ } else if (dev->at_eof()) {
if (verbose) {
- Jmsg(jcr, M_INFO, 0, "Got EOF at file %u on device %s, Volume \"%s\"\n",
+ Jmsg(jcr, M_INFO, 0, "Got EOF at file %u on device %s, Volume \"%s\"\n",
dev->file, dev_name(dev), dcr->VolumeName);
}
- Dmsg3(200, "Got EOF at file %u on device %s, Volume \"%s\"\n",
+ Dmsg3(200, "Got EOF at file %u on device %s, Volume \"%s\"\n",
dev->file, dev_name(dev), dcr->VolumeName);
continue;
} else if (dev_state(dev, ST_SHORT)) {
display_tape_error_status(jcr, dev);
if (forge_on || jcr->ignore_label_errors) {
fsr_dev(dev, 1); /* try skipping bad record */
- Dmsg0(000, "Did fsr\n");
+ Pmsg0(000, "Did fsr\n");
continue; /* try to continue */
}
- ok = false;
+ ok = false; /* stop everything */
break;
}
}
/*
* Get a new record for each Job as defined by
- * VolSessionId and VolSessionTime
+ * VolSessionId and VolSessionTime
*/
bool found = false;
foreach_dlist(rec, recs) {
recs->prepend(rec);
Dmsg2(300, "New record for SI=%d ST=%d\n",
block->VolSessionId, block->VolSessionTime);
- } else {
-#ifdef xxx
- if (rec->Block != 0 && (rec->Block+1) != block->BlockNumber) {
- Jmsg(jcr, M_ERROR, 0, _("Invalid block number. Expected %u, got %u\n"),
- rec->Block+1, block->BlockNumber);
- }
-#endif
}
- Dmsg3(300, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec),
+ Dmsg3(300, "After mount next vol. stat=%s blk=%d rem=%d\n", rec_state_to_str(rec),
block->BlockNumber, rec->remainder);
record = 0;
rec->state = 0;
Dmsg1(300, "Block empty %d\n", is_block_empty(rec));
for (rec->state=0; !is_block_empty(rec); ) {
if (!read_record_from_block(block, rec)) {
- Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
+ Dmsg3(400, "!read-break. state=%s blk=%d rem=%d\n", rec_state_to_str(rec),
block->BlockNumber, rec->remainder);
break;
}
- Dmsg5(300, "read-OK. state=%s blk=%d rem=%d file:block=%d:%d\n",
+ Dmsg5(300, "read-OK. state=%s blk=%d rem=%d file:block=%d:%d\n",
rec_state_to_str(rec), block->BlockNumber, rec->remainder,
dev->file, dev->block_num);
/*
break; /* yes, get out */
}
- /* Some sort of label? */
+ /* Some sort of label? */
if (rec->FileIndex < 0) {
handle_session_record(dev, rec, &sessrec);
ok = record_cb(dcr, rec);
continue;
} /* end if label record */
- /*
+ /*
* Apply BSR filter
*/
if (jcr->bsr) {
Dmsg2(300, "All done=(file:block) %d:%d\n", dev->file, dev->block_num);
break;
} else if (stat == 0) { /* no match */
- Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %d:%d\n",
+ Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %d:%d\n",
rec->remainder, rec->FileIndex, dev->file, dev->block_num);
rec->remainder = 0;
rec->state &= ~REC_PARTIAL_RECORD;
Dmsg2(300, "Current postion (file:block) %d:%d\n",
dev->file, dev->block_num);
jcr->bsr->mount_next_volume = false;
- dev->state |= ST_EOT;
+ if (!dev->at_eot()) {
+ /* Set EOT flag to force mount of next Volume */
+ jcr->mount_next_volume = true;
+ dev->state |= ST_EOT;
+ }
rec->Block = 0;
return 1;
- }
+ }
if (bsr) {
if (verbose) {
Jmsg(jcr, M_INFO, 0, "Reposition from (file:block) %d:%d to %d:%d\n",
{
BSR *bsr = NULL;
/*
- * Now find and position to first file and block
+ * Now find and position to first file and block
* on this tape.
*/
if (jcr->bsr) {
jcr->bsr->reposition = true; /* force repositioning */
bsr = find_next_bsr(jcr->bsr, dev);
if (bsr && (bsr->volfile->sfile != 0 || bsr->volblock->sblock != 0)) {
- Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"),
+ Jmsg(jcr, M_INFO, 0, _("Forward spacing to file:block %u:%u.\n"),
bsr->volfile->sfile, bsr->volblock->sblock);
- Dmsg2(300, "Forward spacing to file:block %u:%u.\n",
+ Dmsg2(300, "Forward spacing to file:block %u:%u.\n",
bsr->volfile->sfile, bsr->volblock->sblock);
reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock);
}
{
const char *rtype;
char buf[100];
-
+
memset(sessrec, 0, sizeof(sessrec));
switch (rec->FileIndex) {
case PRE_LABEL:
- rtype = "Fresh Volume Label";
+ rtype = "Fresh Volume Label";
break;
case VOL_LABEL:
rtype = "Volume Label";
#ifdef DEBUG
static char *rec_state_to_str(DEV_RECORD *rec)
{
- static char buf[200];
+ static char buf[200];
buf[0] = 0;
if (rec->state & REC_NO_HEADER) {
bstrncat(buf, "Nohdr,", sizeof(buf));
}
-/*
+/*
* Convert a Stream ID into a printable
* ASCII string. Not reentrant.
static char buf[20];
if (fi < 0) {
sprintf(buf, "%d", stream);
- return buf;
+ return buf;
}
switch (stream) {
case STREAM_UNIX_ATTRIBUTES:
return "PROG-NAMES";
case STREAM_PROGRAM_DATA:
return "PROG-DATA";
+ case STREAM_MACOS_FORK_DATA:
+ return "MACOS-RSRC";
+ case STREAM_HFSPLUS_ATTRIBUTES:
+ return "HFSPLUS-ATTR";
case -STREAM_UNIX_ATTRIBUTES:
return "contUATTR";
case -STREAM_FILE_DATA:
return "contPROG-NAMES";
case -STREAM_PROGRAM_DATA:
return "contPROG-DATA";
+ case -STREAM_MACOS_FORK_DATA:
+ return "contMACOS-RSRC";
+ case -STREAM_HFSPLUS_ATTRIBUTES:
+ return "contHFSPLUS-ATTR";
default:
sprintf(buf, "%d", stream);
- return buf;
+ return buf;
}
}
-/*
+/*
* Return a new record entity
*/
DEV_RECORD *new_record(void)
}
/*
- * Free the record entity
+ * Free the record entity
*
*/
-void free_record(DEV_RECORD *rec)
+void free_record(DEV_RECORD *rec)
{
Dmsg0(350, "Enter free_record.\n");
if (rec->data) {
Dmsg0(350, "Data buf is freed.\n");
free_pool_memory((POOLMEM *)rec);
Dmsg0(350, "Leave free_record.\n");
-}
+}
/*
ASSERT(block->binbuf == (uint32_t) (block->bufp - block->buf));
ASSERT(block->buf_len >= block->binbuf);
- Dmsg6(890, "write_record_to_block() FI=%s SessId=%d Strm=%s len=%d\n\
-rem=%d remainder=%d\n",
- FI_to_ascii(rec->FileIndex), rec->VolSessionId,
+ Dmsg6(890, "write_record_to_block() FI=%s SessId=%d Strm=%s len=%d\n"
+"rem=%d remainder=%d\n",
+ FI_to_ascii(rec->FileIndex), rec->VolSessionId,
stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len,
remlen, rec->remainder);
return false;
}
} else {
- /*
+ /*
* We are here to write unwritten bytes from a previous
- * time. Presumably we have a new buffer (possibly
- * containing a volume label), so the new header
+ * time. Presumably we have a new buffer (possibly
+ * containing a volume label), so the new header
* should be able to fit in the block -- otherwise we have
* an error. Note, we have to continue splitting the
* data record if it is longer than the block.
- *
- * First, write the header, then write as much as
+ *
+ * First, write the header, then write as much as
* possible of the data record.
*
* Every time we write a header and it is a continuation
/*
* Now deal with data record.
- * Part of it may have already been transferred, and we
+ * Part of it may have already been transferred, and we
* may not have enough room to transfer the whole this time.
*/
if (rec->remainder > 0) {
block->bufp += rec->remainder;
block->binbuf += rec->remainder;
} else {
- memcpy(block->bufp, rec->data+rec->data_len-rec->remainder,
+ memcpy(block->bufp, rec->data+rec->data_len-rec->remainder,
remlen);
#ifdef xxxxxSMCHECK
if (!sm_check_rtn(__FILE__, __LINE__, False)) {
/* We damaged a buffer */
- Dmsg6(0, "Damaged block FI=%s SessId=%d Strm=%s len=%d\n\
-rem=%d remainder=%d\n",
- FI_to_ascii(rec->FileIndex), rec->VolSessionId,
+ Dmsg6(0, "Damaged block FI=%s SessId=%d Strm=%s len=%d\n"
+"rem=%d remainder=%d\n",
+ FI_to_ascii(rec->FileIndex), rec->VolSessionId,
stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len,
remlen, rec->remainder);
Dmsg5(0, "Damaged block: bufp=%x binbuf=%d buf_len=%d rem=%d moved=%d\n",
/*
* Test if we can write whole record to the block
*
- * Returns: false on failure
+ * Returns: false on failure
* true on success (all bytes can be written)
*/
bool can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec)
* Read a Record from the block
* Returns: false if nothing read or if the continuation record does not match.
* In both of these cases, a block read must be done.
- * true if at least the record header was read, this
+ * true if at least the record header was read, this
* routine may have to be called again with a new
* block if the entire record was not read.
*/
rec->Block = block->BlockNumber;
rec->File = ((DEVICE *)block->dev)->file;
- /* Clear state flags */
+ /* Clear state flags */
rec->state = 0;
- if (((DEVICE *)block->dev)->state & ST_TAPE) {
+ if (block->dev->is_tape()) {
rec->state |= REC_ISTAPE;
}
- /*
+ /*
* Get the header. There is always a full header,
* otherwise we find it in the next block.
*/
rhl = RECHDR2_LENGTH;
}
if (remlen >= rhl) {
- Dmsg4(450, "Enter read_record_block: remlen=%d data_len=%d rem=%d blkver=%d\n",
+ Dmsg4(450, "Enter read_record_block: remlen=%d data_len=%d rem=%d blkver=%d\n",
remlen, rec->data_len, rec->remainder, block->BlockVer);
unser_begin(block->bufp, WRITE_RECHDR_LENGTH);
/* If we are looking for more (remainder!=0), we reject anything
* where the VolSessionId and VolSessionTime don't agree
*/
- if (rec->remainder && (rec->VolSessionId != VolSessionId ||
+ if (rec->remainder && (rec->VolSessionId != VolSessionId ||
rec->VolSessionTime != VolSessionTime)) {
rec->state |= REC_NO_MATCH;
Dmsg0(450, "remainder and VolSession doesn't match\n");
* of a previous partially written record.
*/
if (Stream < 0) { /* continuation record? */
- Dmsg1(500, "Got negative Stream => continuation. remainder=%d\n",
+ Dmsg1(500, "Got negative Stream => continuation. remainder=%d\n",
rec->remainder);
rec->state |= REC_CONTINUATION;
if (!rec->remainder) { /* if we didn't read previously */
Dmsg6(450, "rd_rec_blk() got FI=%s SessId=%d Strm=%s len=%u\n"
"remlen=%d data_len=%d\n",
- FI_to_ascii(rec->FileIndex), rec->VolSessionId,
- stream_to_ascii(rec->Stream, rec->FileIndex), data_bytes, remlen,
+ FI_to_ascii(rec->FileIndex), rec->VolSessionId,
+ stream_to_ascii(rec->Stream, rec->FileIndex), data_bytes, remlen,
rec->data_len);
} else {
- /*
- * No more records in this block because the number
- * of remaining bytes are less than a record header
+ /*
+ * No more records in this block because the number
+ * of remaining bytes are less than a record header
* length, so return empty handed, but indicate that
* he must read again. By returning, we allow the
* higher level routine to fetch the next block and
* then reread.
*/
Dmsg0(450, "read_record_block: nothing\n");
-#ifdef xxx
- if (!rec->remainder) {
- rec->remainder = 1; /* set to expect continuation */
- rec->data_len = 0; /* no data transferred */
- }
-#endif
rec->state |= (REC_NO_HEADER | REC_BLOCK_EMPTY);
empty_block(block); /* mark block empty */
return false;
ASSERT(data_bytes < MAX_BLOCK_LENGTH); /* temp sanity check */
rec->data = check_pool_memory_size(rec->data, rec->data_len+data_bytes);
-
+
/*
* At this point, we have read the header, now we
- * must transfer as much of the data record as
+ * must transfer as much of the data record as
* possible taking into account: 1. A partial
* data record may have previously been transferred,
* 2. The current block may not contain the whole data
}
rec->remainder = 0;
Dmsg4(450, "Rtn full rd_rec_blk FI=%s SessId=%d Strm=%s len=%d\n",
- FI_to_ascii(rec->FileIndex), rec->VolSessionId,
+ FI_to_ascii(rec->FileIndex), rec->VolSessionId,
stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len);
return true; /* transferred full record */
}
/*
- * Spooling code
+ * Spooling code
*
- * Kern Sibbald, March 2004
+ * Kern Sibbald, March 2004
*
* Version $Id$
*/
/*
- Copyright (C) 2004-2004 Kern Sibbald and John Walker
+ Copyright (C) 2004-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static bool write_spool_data(DCR *dcr);
struct spool_stats_t {
- uint32_t data_jobs; /* current jobs spooling data */
- uint32_t attr_jobs;
- uint32_t total_data_jobs; /* total jobs to have spooled data */
+ uint32_t data_jobs; /* current jobs spooling data */
+ uint32_t attr_jobs;
+ uint32_t total_data_jobs; /* total jobs to have spooled data */
uint32_t total_attr_jobs;
- int64_t max_data_size; /* max data size */
+ int64_t max_data_size; /* max data size */
int64_t max_attr_size;
- int64_t data_size; /* current data size (all jobs running) */
+ int64_t data_size; /* current data size (all jobs running) */
int64_t attr_size;
};
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
spool_stats_t spool_stats;
-/*
+/*
* Header for data spool record */
struct spool_hdr {
- int32_t FirstIndex; /* FirstIndex for buffer */
- int32_t LastIndex; /* LastIndex for buffer */
- uint32_t len; /* length of next buffer */
+ int32_t FirstIndex; /* FirstIndex for buffer */
+ int32_t LastIndex; /* LastIndex for buffer */
+ uint32_t len; /* length of next buffer */
};
enum {
char ed1[30], ed2[30];
if (spool_stats.data_jobs || spool_stats.max_data_size) {
bnet_fsend(bs, "Data spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes/job.\n",
- spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
- spool_stats.total_data_jobs,
- edit_uint64_with_commas(spool_stats.max_data_size, ed2));
+ spool_stats.data_jobs, edit_uint64_with_commas(spool_stats.data_size, ed1),
+ spool_stats.total_data_jobs,
+ edit_uint64_with_commas(spool_stats.max_data_size, ed2));
}
if (spool_stats.attr_jobs || spool_stats.max_attr_size) {
bnet_fsend(bs, "Attr spooling: %u active jobs, %s bytes; %u total jobs, %s max bytes.\n",
- spool_stats.attr_jobs, edit_uint64_with_commas(spool_stats.attr_size, ed1),
- spool_stats.total_attr_jobs,
- edit_uint64_with_commas(spool_stats.max_attr_size, ed2));
+ spool_stats.attr_jobs, edit_uint64_with_commas(spool_stats.attr_size, ed1),
+ spool_stats.total_attr_jobs,
+ edit_uint64_with_commas(spool_stats.max_attr_size, ed2));
}
}
jcr->dcr->spool_data = true;
stat = open_data_spool_file(jcr);
if (stat) {
- jcr->dcr->spooling = true;
+ jcr->dcr->spooling = true;
Jmsg(jcr, M_INFO, 0, _("Spooling data ...\n"));
- P(mutex);
- spool_stats.data_jobs++;
- V(mutex);
+ P(mutex);
+ spool_stats.data_jobs++;
+ V(mutex);
}
}
return stat;
stat = despool_data(jcr->dcr, true /*commit*/);
if (!stat) {
Pmsg1(000, "Bad return from despool WroteVol=%d\n", jcr->dcr->WroteVol);
- close_data_spool_file(jcr);
- return false;
+ close_data_spool_file(jcr);
+ return false;
}
return close_data_spool_file(jcr);
}
static void make_unique_data_spool_filename(JCR *jcr, POOLMEM **name)
{
- const char *dir;
+ const char *dir;
if (jcr->dcr->dev->device->spool_directory) {
dir = jcr->dcr->dev->device->spool_directory;
} else {
dir = working_directory;
}
- Mmsg(name, "%s/%s.data.spool.%s.%s", dir, my_name, jcr->Job, jcr->device->hdr.name);
+ Mmsg(name, "%s/%s.data.spool.%s.%s", dir, my_name, jcr->Job,
+ jcr->dcr->device->hdr.name);
}
} else {
berrno be;
Jmsg(jcr, M_FATAL, 0, _("Open data spool file %s failed: ERR=%s\n"), name,
- be.strerror());
+ be.strerror());
free_pool_memory(name);
return false;
}
static const char *spool_name = "*spool*";
-static bool despool_data(DCR *dcr, bool commit)
+static bool despool_data(DCR *dcr, bool commit)
{
DEVICE *rdev;
DCR *rdcr;
Dmsg0(100, "Despooling data\n");
Jmsg(jcr, M_INFO, 0, _("%s spooled data to Volume. Despooling %s bytes ...\n"),
commit?"Committing":"Writing",
- edit_uint64_with_commas(jcr->dcr->dev->spool_size, ec1));
+ edit_uint64_with_commas(jcr->dcr->spool_size, ec1));
dcr->spooling = false;
lock_device(dcr->dev);
- dcr->dev_locked = true;
+ dcr->dev_locked = true;
- /*
+ /*
* This is really quite kludgy and should be fixed some time.
- * We create a dev structure to read from the spool file
+ * We create a dev structure to read from the spool file
* in rdev and rdcr.
*/
rdev = (DEVICE *)malloc(sizeof(DEVICE));
rdev->min_block_size = dcr->dev->min_block_size;
rdev->device = dcr->dev->device;
rdcr = new_dcr(NULL, rdev);
- rdcr->spool_fd = dcr->spool_fd;
- rdcr->jcr = jcr; /* set a valid jcr */
- block = dcr->block; /* save block */
- dcr->block = rdcr->block; /* make read and write block the same */
+ rdcr->spool_fd = dcr->spool_fd;
+ rdcr->jcr = jcr; /* set a valid jcr */
+ block = dcr->block; /* save block */
+ dcr->block = rdcr->block; /* make read and write block the same */
Dmsg1(800, "read/write block size = %d\n", block->buf_len);
lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
for ( ; ok; ) {
if (job_canceled(jcr)) {
- ok = false;
- break;
+ ok = false;
+ break;
}
stat = read_block_from_spool_file(rdcr);
if (stat == RB_EOT) {
- break;
+ break;
} else if (stat == RB_ERROR) {
- ok = false;
- break;
+ ok = false;
+ break;
}
ok = write_block_to_device(dcr);
Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, block->LastIndex);
}
- dcr->block = block; /* reset block */
+ dcr->block = block; /* reset block */
lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */
if (ftruncate(rdcr->spool_fd, 0) != 0) {
berrno be;
- Jmsg(dcr->jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"),
- be.strerror());
+ Jmsg(dcr->jcr, M_ERROR, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+ be.strerror());
Pmsg1(000, "Bad return from ftruncate. ERR=%s\n", be.strerror());
ok = false;
}
V(mutex);
P(dcr->dev->spool_mutex);
dcr->dev->spool_size -= dcr->spool_size;
- dcr->spool_size = 0; /* zap size in input dcr */
+ dcr->spool_size = 0; /* zap size in input dcr */
V(dcr->dev->spool_mutex);
free_memory(rdev->dev_name);
free_pool_memory(rdev->errmsg);
free(rdev);
unlock_device(dcr->dev);
dcr->dev_locked = false;
- dcr->spooling = true; /* turn on spooling again */
+ dcr->spooling = true; /* turn on spooling again */
return ok;
}
/*
* Read a block from the spool file
- *
+ *
* Returns RB_OK on success
- * RB_EOT when file done
- * RB_ERROR on error
+ * RB_EOT when file done
+ * RB_ERROR on error
*/
static int read_block_from_spool_file(DCR *dcr)
{
return RB_EOT;
} else if (stat != (ssize_t)rlen) {
if (stat == -1) {
- berrno be;
- Jmsg(dcr->jcr, M_FATAL, 0, _("Spool header read error. ERR=%s\n"),
- be.strerror());
+ berrno be;
+ Jmsg(dcr->jcr, M_FATAL, 0, _("Spool header read error. ERR=%s\n"),
+ be.strerror());
} else {
Pmsg2(000, "Spool read error. Wanted %u bytes, got %u\n", rlen, stat);
Jmsg2(dcr->jcr, M_FATAL, 0, _("Spool header read error. Wanted %u bytes, got %u\n"), rlen, stat);
* Write a block to the spool file
*
* Returns: true on success or EOT
- * false on hard error
+ * false on hard error
*/
bool write_block_to_spool_file(DCR *dcr)
{
- uint32_t wlen, hlen; /* length to write */
+ uint32_t wlen, hlen; /* length to write */
bool despool = false;
DEV_BLOCK *block = dcr->block;
ASSERT(block->binbuf == ((uint32_t) (block->bufp - block->buf)));
- if (block->binbuf <= WRITE_BLKHDR_LENGTH) { /* Does block have data in it? */
+ if (block->binbuf <= WRITE_BLKHDR_LENGTH) { /* Does block have data in it? */
return true;
}
}
V(mutex);
if (despool) {
-#ifdef xDEBUG
+#ifdef xDEBUG
char ec1[30], ec2[30], ec3[30], ec4[30];
Dmsg4(100, "Despool in write_block_to_spool_file max_size=%s size=%s "
- "max_job_size=%s job_size=%s\n",
- edit_uint64_with_commas(dcr->max_spool_size, ec1),
- edit_uint64_with_commas(dcr->spool_size, ec2),
- edit_uint64_with_commas(dcr->dev->max_spool_size, ec3),
- edit_uint64_with_commas(dcr->dev->spool_size, ec4));
+ "max_job_size=%s job_size=%s\n",
+ edit_uint64_with_commas(dcr->max_spool_size, ec1),
+ edit_uint64_with_commas(dcr->spool_size, ec2),
+ edit_uint64_with_commas(dcr->dev->max_spool_size, ec3),
+ edit_uint64_with_commas(dcr->dev->spool_size, ec4));
#endif
Jmsg(dcr->jcr, M_INFO, 0, _("User specified spool size reached.\n"));
if (!despool_data(dcr, false)) {
Pmsg0(000, "Bad return from despool in write_block.\n");
- return false;
+ return false;
}
/* Despooling cleared these variables so reset them */
P(dcr->dev->spool_mutex);
dcr->dev->spool_size += hlen + wlen;
V(dcr->dev->spool_mutex);
Jmsg(dcr->jcr, M_INFO, 0, _("Spooling data again ...\n"));
- }
+ }
if (!write_spool_header(dcr)) {
static bool write_spool_header(DCR *dcr)
{
- spool_hdr hdr;
+ spool_hdr hdr;
ssize_t stat;
DEV_BLOCK *block = dcr->block;
for (int retry=0; retry<=1; retry++) {
stat = write(dcr->spool_fd, (char*)&hdr, sizeof(hdr));
if (stat == -1) {
- berrno be;
- Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing header to spool file. ERR=%s\n"),
- be.strerror());
+ berrno be;
+ Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing header to spool file. ERR=%s\n"),
+ be.strerror());
}
if (stat != (ssize_t)sizeof(hdr)) {
- /* If we wrote something, truncate it, then despool */
- if (stat != -1) {
- if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR) - stat) != 0) {
- berrno be;
- Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
- be.strerror());
- return false;
- }
- }
- if (!despool_data(dcr, false)) {
+ /* If we wrote something, truncate it, then despool */
+ if (stat != -1) {
+ if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR) - stat) != 0) {
+ berrno be;
+ Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+ be.strerror());
+ return false;
+ }
+ }
+ if (!despool_data(dcr, false)) {
Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
- return false;
- }
- continue; /* try again */
+ return false;
+ }
+ continue; /* try again */
}
return true;
}
for (int retry=0; retry<=1; retry++) {
stat = write(dcr->spool_fd, block->buf, (size_t)block->binbuf);
if (stat == -1) {
- berrno be;
+ berrno be;
Jmsg(dcr->jcr, M_FATAL, 0, _("Error writing data to spool file. ERR=%s\n"),
- be.strerror());
+ be.strerror());
}
if (stat != (ssize_t)block->binbuf) {
- /*
- * If we wrote something, truncate it and the header, then despool
- */
- if (stat != -1) {
- if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR)
- - stat - sizeof(spool_hdr)) != 0) {
- berrno be;
- Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
- be.strerror());
- return false;
- }
- }
- if (!despool_data(dcr, false)) {
+ /*
+ * If we wrote something, truncate it and the header, then despool
+ */
+ if (stat != -1) {
+ if (ftruncate(dcr->spool_fd, lseek(dcr->spool_fd, (off_t)0, SEEK_CUR)
+ - stat - sizeof(spool_hdr)) != 0) {
+ berrno be;
+ Jmsg(dcr->jcr, M_FATAL, 0, _("Ftruncate spool file failed: ERR=%s\n"),
+ be.strerror());
+ return false;
+ }
+ }
+ if (!despool_data(dcr, false)) {
Jmsg(dcr->jcr, M_FATAL, 0, _("Fatal despooling error."));
- return false;
- }
- if (!write_spool_header(dcr)) {
- return false;
- }
- continue; /* try again */
+ return false;
+ }
+ if (!write_spool_header(dcr)) {
+ return false;
+ }
+ continue; /* try again */
}
return true;
}
return jcr->spool_attributes && jcr->dir_bsock->spool_fd;
}
-/*
+/*
* Create spool file for attributes.
* This is done by "attaching" to the bsock, and when
* it is called, the output is written to a file.
P(mutex);
if (size > 0) {
if ((spool_stats.attr_size - size) > 0) {
- spool_stats.attr_size -= size;
+ spool_stats.attr_size -= size;
} else {
- spool_stats.attr_size = 0;
+ spool_stats.attr_size = 0;
}
}
V(mutex);
bool commit_attribute_spool(JCR *jcr)
{
- ssize_t size;
+ off_t size;
char ec1[30];
if (are_attributes_spooled(jcr)) {
- if (fseek(jcr->dir_bsock->spool_fd, 0, SEEK_END) != 0) {
- berrno be;
+ if (fseeko(jcr->dir_bsock->spool_fd, 0, SEEK_END) != 0) {
+ berrno be;
Jmsg(jcr, M_FATAL, 0, _("Fseek on attributes file failed: ERR=%s\n"),
- be.strerror());
+ be.strerror());
+ goto bail_out;
+ }
+ size = ftello(jcr->dir_bsock->spool_fd);
+ if (size < 0) {
+ berrno be;
+ Jmsg(jcr, M_FATAL, 0, _("Ftell on attributes file failed: ERR=%s\n"),
+ be.strerror());
+ goto bail_out;
}
- size = ftell(jcr->dir_bsock->spool_fd);
P(mutex);
- if (size > 0) {
- if (spool_stats.attr_size + size > spool_stats.max_attr_size) {
- spool_stats.max_attr_size = spool_stats.attr_size + size;
- }
+ if (spool_stats.attr_size + size > spool_stats.max_attr_size) {
+ spool_stats.max_attr_size = spool_stats.attr_size + size;
}
spool_stats.attr_size += size;
V(mutex);
Jmsg(jcr, M_INFO, 0, _("Sending spooled attrs to the Director. Despooling %s bytes ...\n"),
- edit_uint64_with_commas(size, ec1));
+ edit_uint64_with_commas(size, ec1));
bnet_despool_to_bsock(jcr->dir_bsock, update_attr_spool_size, size);
return close_attr_spool_file(jcr, jcr->dir_bsock);
}
return true;
+
+bail_out:
+ close_attr_spool_file(jcr, jcr->dir_bsock);
+ return false;
}
static void make_unique_spool_filename(JCR *jcr, POOLMEM **name, int fd)
if (!bs->spool_fd) {
berrno be;
Jmsg(jcr, M_FATAL, 0, _("fopen attr spool file %s failed: ERR=%s\n"), name,
- be.strerror());
+ be.strerror());
free_pool_memory(name);
return false;
}
bool close_attr_spool_file(JCR *jcr, BSOCK *bs)
{
POOLMEM *name;
-
+
if (!bs->spool_fd) {
return true;
}
* Kern Sibbald, May MMIII
*
* Version $Id$
- *
+ *
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
bnet_fsend(user, _("\nDevice status:\n"));
LockRes();
foreach_res(device, R_DEVICE) {
- for (dev=device->dev; dev; dev=dev->next) {
- if (dev_state(dev, ST_OPENED)) {
- if (dev_state(dev, ST_LABEL)) {
- bnet_fsend(user, _("Device \"%s\" is mounted with Volume \"%s\"\n"),
- dev_name(dev), dev->VolHdr.VolName);
- } else {
- bnet_fsend(user, _("Device \"%s\" open but no Bacula volume is mounted.\n"), dev_name(dev));
+ dev = device->dev;
+ if (dev && dev->is_open()) {
+ if (dev->is_labeled()) {
+ bnet_fsend(user, _("Device \"%s\" is mounted with Volume \"%s\"\n"),
+ dev_name(dev), dev->VolHdr.VolName);
+ } else {
+ bnet_fsend(user, _("Device \"%s\" open but no Bacula volume is mounted.\n"), dev_name(dev));
+ }
+ send_blocked_status(jcr, dev);
+ if (dev_state(dev, ST_APPEND)) {
+ bpb = dev->VolCatInfo.VolCatBlocks;
+ if (bpb <= 0) {
+ bpb = 1;
}
- send_blocked_status(jcr, dev);
- if (dev_state(dev, ST_APPEND)) {
- bpb = dev->VolCatInfo.VolCatBlocks;
- if (bpb <= 0) {
- bpb = 1;
- }
- bpb = dev->VolCatInfo.VolCatBytes / bpb;
- bnet_fsend(user, _(" Total Bytes=%s Blocks=%s Bytes/block=%s\n"),
- edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, b1),
- edit_uint64_with_commas(dev->VolCatInfo.VolCatBlocks, b2),
- edit_uint64_with_commas(bpb, b3));
- } else { /* reading */
- bpb = dev->VolCatInfo.VolCatReads;
- if (bpb <= 0) {
- bpb = 1;
- }
- if (dev->VolCatInfo.VolCatRBytes > 0) {
- bpb = dev->VolCatInfo.VolCatRBytes / bpb;
- } else {
- bpb = 0;
- }
- bnet_fsend(user, _(" Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n"),
- edit_uint64_with_commas(dev->VolCatInfo.VolCatRBytes, b1),
- edit_uint64_with_commas(dev->VolCatInfo.VolCatReads, b2),
- edit_uint64_with_commas(bpb, b3));
+ bpb = dev->VolCatInfo.VolCatBytes / bpb;
+ bnet_fsend(user, _(" Total Bytes=%s Blocks=%s Bytes/block=%s\n"),
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, b1),
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatBlocks, b2),
+ edit_uint64_with_commas(bpb, b3));
+ } else { /* reading */
+ bpb = dev->VolCatInfo.VolCatReads;
+ if (bpb <= 0) {
+ bpb = 1;
}
- bnet_fsend(user, _(" Positioned at File=%s Block=%s\n"),
- edit_uint64_with_commas(dev->file, b1),
- edit_uint64_with_commas(dev->block_num, b2));
-
- } else {
- bnet_fsend(user, _("Device \"%s\" is not open.\n"), dev_name(dev));
- send_blocked_status(jcr, dev);
+ if (dev->VolCatInfo.VolCatRBytes > 0) {
+ bpb = dev->VolCatInfo.VolCatRBytes / bpb;
+ } else {
+ bpb = 0;
+ }
+ bnet_fsend(user, _(" Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n"),
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatRBytes, b1),
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatReads, b2),
+ edit_uint64_with_commas(bpb, b3));
}
+ bnet_fsend(user, _(" Positioned at File=%s Block=%s\n"),
+ edit_uint64_with_commas(dev->file, b1),
+ edit_uint64_with_commas(dev->block_num, b2));
+
+ } else {
+ bnet_fsend(user, _("Archive \"%s\" is not open or does not exist.\n"), device->hdr.name);
+ send_blocked_status(jcr, dev);
}
}
UnlockRes();
-
-#ifdef xfull_status
- bnet_fsend(user, "\n\n");
- dump_resource(R_DEVICE, resources[R_DEVICE-r_first].res_head, sendit, user);
-#endif
+#ifdef xxx
+ if (debug_level > 0) {
+ bnet_fsend(user, "====\n\n");
+ dump_resource(R_DEVICE, resources[R_DEVICE-r_first].res_head, sendit, user);
+ }
bnet_fsend(user, "====\n\n");
+#endif
list_spool_stats(user);
return true;
}
-static void send_blocked_status(JCR *jcr, DEVICE *dev)
+static void send_blocked_status(JCR *jcr, DEVICE *dev)
{
BSOCK *user = jcr->dir_bsock;
DCR *dcr = jcr->dcr;
+ if (!dev) {
+ return;
+ }
switch (dev->dev_blocked) {
case BST_UNMOUNTED:
bnet_fsend(user, _(" Device is BLOCKED. User unmounted.\n"));
bnet_fsend(user, "\n");
bnet_fsend(user, _("Device status:\n"));
- bnet_fsend(user, "%sOPENED ", dev->state & ST_OPENED ? "" : "!");
- bnet_fsend(user, "%sTAPE ", dev->state & ST_TAPE ? "" : "!");
- bnet_fsend(user, "%sLABEL ", dev->state & ST_LABEL ? "" : "!");
+ bnet_fsend(user, "%sOPENED ", dev->is_open() ? "" : "!");
+ bnet_fsend(user, "%sTAPE ", dev->is_tape() ? "" : "!");
+ bnet_fsend(user, "%sLABEL ", dev->is_labeled() ? "" : "!");
bnet_fsend(user, "%sMALLOC ", dev->state & ST_MALLOC ? "" : "!");
- bnet_fsend(user, "%sAPPEND ", dev->state & ST_APPEND ? "" : "!");
- bnet_fsend(user, "%sREAD ", dev->state & ST_READ ? "" : "!");
- bnet_fsend(user, "%sEOT ", dev->state & ST_EOT ? "" : "!");
+ bnet_fsend(user, "%sAPPEND ", dev->can_append() ? "" : "!");
+ bnet_fsend(user, "%sREAD ", dev->can_read() ? "" : "!");
+ bnet_fsend(user, "%sEOT ", dev->at_eot() ? "" : "!");
bnet_fsend(user, "%sWEOT ", dev->state & ST_WEOT ? "" : "!");
- bnet_fsend(user, "%sEOF ", dev->state & ST_EOF ? "" : "!");
+ bnet_fsend(user, "%sEOF ", dev->at_eof() ? "" : "!");
bnet_fsend(user, "%sNEXTVOL ", dev->state & ST_NEXTVOL ? "" : "!");
bnet_fsend(user, "%sSHORT ", dev->state & ST_SHORT ? "" : "!");
+ bnet_fsend(user, "%sMOUNTED ", dev->state & ST_MOUNTED ? "" : "!");
bnet_fsend(user, "\n");
bnet_fsend(user, _("Device parameters:\n"));
- bnet_fsend(user, "Device name: %s\n", dev->dev_name);
+ bnet_fsend(user, "Archive name: %s Device name: %s\n", dev->dev_name,
+ dev->device->hdr.name);
bnet_fsend(user, "File=%u block=%u\n", dev->file, dev->block_num);
bnet_fsend(user, "Min block=%u Max block=%u\n", dev->min_block_size, dev->max_block_size);
}
JCR *jcr;
char JobName[MAX_NAME_LENGTH];
char b1[30], b2[30], b3[30];
-
+
bnet_fsend(user, _("\nRunning Jobs:\n"));
lock_jcr_chain();
foreach_jcr(jcr) {
bnet_fsend(user, _("%s Job %s waiting for Client connection.\n"),
job_type_to_str(jcr->JobType), jcr->Job);
}
- if (jcr->device) {
+ if (jcr->dcr && jcr->dcr->device) {
bstrncpy(JobName, jcr->Job, sizeof(JobName));
/* There are three periods after the Job name */
char *p;
*p = 0;
}
}
- bnet_fsend(user, _("%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n"),
+ bnet_fsend(user, _("%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n"),
job_level_to_str(jcr->JobLevel),
job_type_to_str(jcr->JobType),
JobName,
jcr->JobId,
- jcr->dcr?jcr->dcr->VolumeName:"*none*",
- jcr->device?jcr->device->device_name:"none");
+ jcr->dcr->VolumeName,
+ jcr->dcr->device->device_name);
sec = time(NULL) - jcr->run_time;
if (sec <= 0) {
sec = 1;
}
bps = jcr->JobBytes / sec;
- bnet_fsend(user, _(" Files=%s Bytes=%s Bytes/sec=%s\n"),
+ bnet_fsend(user, _(" Files=%s Bytes=%s Bytes/sec=%s\n"),
edit_uint64_with_commas(jcr->JobFiles, b1),
edit_uint64_with_commas(jcr->JobBytes, b2),
edit_uint64_with_commas(bps, b3));
found = true;
#ifdef DEBUG
if (jcr->file_bsock) {
- bnet_fsend(user, " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n",
+ bnet_fsend(user, " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n",
edit_uint64_with_commas(jcr->file_bsock->read_seqno, b1),
jcr->file_bsock->in_msg_no, jcr->file_bsock->out_msg_no,
jcr->file_bsock->fd);
const char *msg;
if (last_jobs->size() == 0) {
- msg = _("No Terminated Jobs.\n");
+ msg = _("No Terminated Jobs.\n");
sendit(msg, strlen(msg), arg);
return;
}
lock_last_jobs_list();
- msg = _("\nTerminated Jobs:\n");
+ msg = _("\nTerminated Jobs:\n");
sendit(msg, strlen(msg), arg);
msg = _(" JobId Level Files Bytes Status Finished Name \n");
sendit(msg, strlen(msg), arg);
- msg = _("======================================================================\n");
+ msg = _("======================================================================\n");
sendit(msg, strlen(msg), arg);
foreach_dlist(je, last_jobs) {
char JobName[MAX_NAME_LENGTH];
*p = 0;
}
}
- bsnprintf(buf, sizeof(buf), _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
+ bsnprintf(buf, sizeof(buf), _("%6d %-6s %8s %14s %-7s %-8s %s\n"),
je->JobId,
- level,
+ level,
edit_uint64_with_commas(je->JobFiles, b1),
- edit_uint64_with_commas(je->JobBytes, b2),
+ edit_uint64_with_commas(je->JobBytes, b2),
termstat,
dt, JobName);
sendit(buf, strlen(buf), arg);
/*
* Convert Job Level into a string
*/
-static const char *level_to_str(int level)
+static const char *level_to_str(int level)
{
const char *str;
}
/*
- * Send to Director
+ * Send to Director
*/
static void sendit(const char *msg, int len, void *arg)
{
return false;
}
unbash_spaces(time);
-
+
if (strcmp(time.c_str(), "current") == 0) {
bnet_fsend(dir, OKqstatus, time.c_str());
lock_jcr_chain();
* It accepts a number of simple commands from the File daemon
* and acts on them. When a request to append data is made,
* it opens a data channel and accepts data from the
- * File daemon.
+ * File daemon.
*
* Version $Id$
- *
+ *
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static void usage()
{
fprintf(stderr, _(
-"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
+"Copyright (C) 2000-2005 Kern Sibbald.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: stored [options] [-c config_file] [config_file]\n"
" -c <file> use <file> as configuration file\n"
exit(1);
}
-/*********************************************************************
+/*********************************************************************
*
* Main Bacula Unix Storage Daemon
*
*/
int main (int argc, char *argv[])
{
- int ch;
+ int ch;
int no_signals = FALSE;
int test_config = FALSE;
pthread_t thid;
daemon_start_time = time(NULL);
/* Sanity checks */
- if (TAPE_BSIZE % DEV_BSIZE != 0 || TAPE_BSIZE / DEV_BSIZE == 0) {
+ if (TAPE_BSIZE % B_DEV_BSIZE != 0 || TAPE_BSIZE / B_DEV_BSIZE == 0) {
Emsg2(M_ABORT, 0, "Tape block size (%d) not multiple of system size (%d)\n",
- TAPE_BSIZE, DEV_BSIZE);
+ TAPE_BSIZE, B_DEV_BSIZE);
}
if (TAPE_BSIZE != (1 << (ffs(TAPE_BSIZE)-1))) {
Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0) {
- debug_level = 1;
+ debug_level = 1;
}
break;
default:
usage();
break;
- }
+ }
}
argc -= optind;
argv += optind;
free(configfile);
}
configfile = bstrdup(*argv);
- argc--;
+ argc--;
argv++;
}
if (argc)
init_signals(terminate_stored);
}
-
if (configfile == NULL) {
configfile = bstrdup(CONFIG_FILE);
}
*/
VolSessionTime = (long)daemon_start_time;
if (VolSessionTime == 0) { /* paranoid */
- Emsg0(M_ABORT, 0, _("Volume Session Time is ZERO!\n"));
+ Jmsg0(NULL, M_ABORT, 0, _("Volume Session Time is ZERO!\n"));
}
/* Make sure on Solaris we can run concurrent, watch dog + servers + misc */
init_jcr_subsystem(); /* start JCR watchdogs etc. */
- /*
+ /*
* Sleep a bit to give device thread a chance to lock the resource
* chain before we start the server.
*/
bmicrosleep(1, 0);
-
+
/* Single server used for Director and File daemon */
bnet_thread_server(me->sdaddrs, me->max_concurrent_jobs * 2 + 1,
&dird_workq, handle_connection_request);
me = (STORES *)GetNextRes(R_STORAGE, NULL);
if (!me) {
UnlockRes();
- Emsg1(M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("No Storage resource defined in %s. Cannot continue.\n"),
configfile);
}
if (GetNextRes(R_STORAGE, (RES *)me) != NULL) {
UnlockRes();
- Emsg1(M_ERROR_TERM, 0, _("Only one Storage resource permitted in %s\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("Only one Storage resource permitted in %s\n"),
configfile);
}
if (GetNextRes(R_DIRECTOR, NULL) == NULL) {
UnlockRes();
- Emsg1(M_ERROR_TERM, 0, _("No Director resource defined in %s. Cannot continue.\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("No Director resource defined in %s. Cannot continue.\n"),
configfile);
}
if (GetNextRes(R_DEVICE, NULL) == NULL){
UnlockRes();
- Emsg1(M_ERROR_TERM, 0, _("No Device resource defined in %s. Cannot continue.\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("No Device resource defined in %s. Cannot continue.\n"),
configfile);
}
if (!me->messages) {
me->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
if (!me->messages) {
- Emsg1(M_ERROR_TERM, 0, _("No Messages resource defined in %s. Cannot continue.\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("No Messages resource defined in %s. Cannot continue.\n"),
configfile);
}
}
UnlockRes();
if (!me->working_directory) {
- Emsg1(M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
+ Jmsg1(NULL, M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
configfile);
}
-
+
set_working_directory(me->working_directory);
}
/*
- * We are started as a separate thread. The
- * resources are alread locked.
+ * Here we attempt to init and open each device. This is done
+ * once at startup in a separate thread.
*/
extern "C"
void *device_allocation(void *arg)
device->dev = init_dev(NULL, device);
Dmsg1(10, "SD init done %s\n", device->device_name);
if (!device->dev) {
- Emsg1(M_ERROR, 0, _("Could not initialize %s\n"), device->device_name);
+ Jmsg1(NULL, M_ERROR, 0, _("Could not initialize %s\n"), device->device_name);
continue;
}
if (device->cap_bits & CAP_ALWAYSOPEN) {
Dmsg1(20, "calling first_open_device %s\n", device->device_name);
if (!first_open_device(device->dev)) {
- Emsg1(M_ERROR, 0, _("Could not open device %s\n"), device->device_name);
+ Jmsg1(NULL, M_ERROR, 0, _("Could not open device %s\n"), device->device_name);
}
}
- if (device->cap_bits & CAP_AUTOMOUNT && device->dev &&
+ if (device->cap_bits & CAP_AUTOMOUNT && device->dev &&
device->dev->state & ST_OPENED) {
JCR *jcr;
DCR *dcr;
if (errstat != 0) {
Jmsg1(jcr, M_ABORT, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat));
}
- jcr->device = device;
dcr = new_dcr(jcr, device->dev);
switch (read_dev_volume_label(dcr)) {
- case VOL_OK:
- memcpy(&dcr->dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dcr->dev->VolCatInfo));
- break;
- default:
- Emsg1(M_WARNING, 0, _("Could not mount device %s\n"), device->device_name);
- break;
+ case VOL_OK:
+ memcpy(&dcr->dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dcr->dev->VolCatInfo));
+ break;
+ default:
+ Jmsg1(NULL, M_WARNING, 0, _("Could not mount device %s\n"), device->device_name);
+ break;
}
free_jcr(jcr);
}
- }
+ }
UnlockRes();
return NULL;
}
continue; /* ignore console */
}
set_jcr_job_status(jcr, JS_Canceled);
- fd = jcr->file_bsock;
+ fd = jcr->file_bsock;
if (fd) {
fd->timed_out = true;
Dmsg1(100, "term_stored killing JobId=%d\n", jcr->JobId);
pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
- if (jcr->device && jcr->device->dev && jcr->device->dev->dev_blocked) {
- pthread_cond_signal(&jcr->device->dev->wait_next_vol);
+ /* ***FIXME*** wiffle through all dcrs */
+ if (jcr->dcr && jcr->dcr->dev && jcr->dcr->dev->dev_blocked) {
+ pthread_cond_signal(&jcr->dcr->dev->wait_next_vol);
}
bmicrosleep(0, 50000);
}
if (device->dev) {
term_dev(device->dev);
}
- }
+ }
UnlockRes();
if (configfile)
* Version $Id$
*/
/*
- Copyright (C) 2000-2004 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "jcr.h"
#include "protos.h"
#ifdef HAVE_LIBZ
-#include <zlib.h> /* compression headers */
+#include <zlib.h> /* compression headers */
#else
#define uLongf uint32_t
#endif
#else
#include "lib/fnmatch.h"
#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#define NAMELEN(dirent) (strlen((dirent)->d_name))
+#endif
+#ifndef HAVE_READDIR_R
+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
+#endif
extern STORES *me; /* "Global" daemon resource */
-extern bool forge_on; /* proceed inspite of I/O errors */
+extern bool forge_on; /* proceed inspite of I/O errors */
#ifdef debug_tracing
extern int _rewind_dev(char *file, int line, DEVICE *dev);
break;
case R_STORAGE:
sendit(sock, "Storage: name=%s SDaddr=%s SDport=%d SDDport=%d HB=%s\n",
- res->res_store.hdr.name,
- NPRT(get_first_address(res->res_store.sdaddrs, buf, sizeof(buf))),
- get_first_port_host_order(res->res_store.sdaddrs),
- get_first_port_host_order(res->res_store.sddaddrs),
- edit_utime(res->res_store.heartbeat_interval, buf, sizeof(buf)));
- foreach_dlist(p, res->res_store.sdaddrs) {
- sendit(sock, " SDaddr=%s SDport=%d\n",
- p->get_address(buf, sizeof(buf)), p->get_port_host_order());
- }
- foreach_dlist(p, res->res_store.sddaddrs) {
- sendit(sock, " SDDaddr=%s SDDport=%d\n",
- p->get_address(buf, sizeof(buf)), p->get_port_host_order());
- }
+ res->res_store.hdr.name,
+ NPRT(get_first_address(res->res_store.sdaddrs, buf, sizeof(buf))),
+ get_first_port_host_order(res->res_store.sdaddrs),
+ get_first_port_host_order(res->res_store.sddaddrs),
+ edit_utime(res->res_store.heartbeat_interval, buf, sizeof(buf)));
+ if (res->res_store.sdaddrs) {
+ foreach_dlist(p, res->res_store.sdaddrs) {
+ sendit(sock, " SDaddr=%s SDport=%d\n",
+ p->get_address(buf, sizeof(buf)), p->get_port_host_order());
+ }
+ }
+ if (res->res_store.sddaddrs) {
+ foreach_dlist(p, res->res_store.sddaddrs) {
+ sendit(sock, " SDDaddr=%s SDDport=%d\n",
+ p->get_address(buf, sizeof(buf)), p->get_port_host_order());
+ }
+ }
break;
case R_DEVICE:
sendit(sock, "Device: name=%s MediaType=%s Device=%s\n",
.c.o:
$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
-all: Makefile bsmtp dbcheck testfind testls
+all: Makefile bsmtp dbcheck fstype testfind testls
@echo "==== Make of tools is good ===="
@echo " "
dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
$(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS)
+fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
+ $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS)
+
testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
$(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
$(DLIB) -lfind -lbac -lm $(LIBS)
clean:
@$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
- @$(RMF) testfind dbcheck testls
+ @$(RMF) testfind dbcheck testls fstype
realclean: clean
@$(RMF) tags
/*
*
* Program to check a Bacula database for consistency and to
- * make repairs
+ * make repairs
*
* Kern E. Sibbald, August 2002
*
case 'd': /* debug level */
debug_level = atoi(optarg);
if (debug_level <= 0)
- debug_level = 1;
+ debug_level = 1;
break;
case 'f': /* fix inconsistencies */
case '?':
default:
usage();
- }
+ }
}
argc -= optind;
argv += optind;
CAT *catalog = NULL;
int found = 0;
if (argc > 0) {
- Pmsg0(0, _("Warning skipping the additional parameters for working directory/dbname/user/password/host.\n"));
+ Pmsg0(0, _("Warning skipping the additional parameters for working directory/dbname/user/password/host.\n"));
}
parse_config(configfile);
LockRes();
foreach_res(catalog, R_CATALOG) {
- if (catalogname && !strcmp(catalog->hdr.name, catalogname)) {
+ if (catalogname && !strcmp(catalog->hdr.name, catalogname)) {
++found;
break;
} else if (!catalogname) { // stop on first if no catalogname is given
UnlockRes();
if (!found) {
if (catalogname) {
- Pmsg2(0, "Error can not find the Catalog name[%s] in the given config file [%s]\n", catalogname, configfile);
+ Pmsg2(0, "Error can not find the Catalog name[%s] in the given config file [%s]\n", catalogname, configfile);
} else {
- Pmsg1(0, "Error there is no Catalog section in the given config file [%s]\n", configfile);
+ Pmsg1(0, "Error there is no Catalog section in the given config file [%s]\n", configfile);
}
exit(1);
} else {
director = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
UnlockRes();
if (!director) {
- Pmsg0(0, "Error no Director resource defined.\n");
+ Pmsg0(0, "Error no Director resource defined.\n");
exit(1);
}
set_working_directory(director->working_directory);
}
} else {
if (argc > 5) {
- Pmsg0(0, _("Wrong number of arguments.\n"));
+ Pmsg0(0, _("Wrong number of arguments.\n"));
usage();
}
if (argc < 1) {
- Pmsg0(0, _("Working directory not supplied.\n"));
+ Pmsg0(0, _("Working directory not supplied.\n"));
usage();
}
bool quit = false;
const char *cmd;
- printf("Hello, this is the database check/correct program.\n\
-Modify database is %s. Verbose is %s.\n\
-Please select the fuction you want to perform.\n",
- fix?"On":"Off", verbose?"On":"Off");
+ printf("Hello, this is the database check/correct program.\n"
+"Modify database is %s. Verbose is %s.\n"
+"Please select the fuction you want to perform.\n",
+ fix?"On":"Off", verbose?"On":"Off");
while (!quit) {
if (fix) {
- printf(_("\n\
- 1) Toggle modify database flag\n\
- 2) Toggle verbose flag\n\
- 3) Repair bad Filename records\n\
- 4) Repair bad Path records\n\
- 5) Eliminate duplicate Filename records\n\
- 6) Eliminate duplicate Path records\n\
- 7) Eliminate orphaned Jobmedia records\n\
- 8) Eliminate orphaned File records\n\
- 9) Eliminate orphaned Path records\n\
- 10) Eliminate orphaned Filename records\n\
- 11) Eliminate orphaned FileSet records\n\
- 12) Eliminate orphaned Client records\n\
- 13) Eliminate orphaned Job records\n\
- 14) Eliminate all Admin records\n\
- 15) Eliminate all Restore records\n\
- 16) All (3-15)\n\
- 17) Quit\n"));
+ printf(_("\n"
+" 1) Toggle modify database flag\n"
+" 2) Toggle verbose flag\n"
+" 3) Repair bad Filename records\n"
+" 4) Repair bad Path records\n"
+" 5) Eliminate duplicate Filename records\n"
+" 6) Eliminate duplicate Path records\n"
+" 7) Eliminate orphaned Jobmedia records\n"
+" 8) Eliminate orphaned File records\n"
+" 9) Eliminate orphaned Path records\n"
+" 10) Eliminate orphaned Filename records\n"
+" 11) Eliminate orphaned FileSet records\n"
+" 12) Eliminate orphaned Client records\n"
+" 13) Eliminate orphaned Job records\n"
+" 14) Eliminate all Admin records\n"
+" 15) Eliminate all Restore records\n"
+" 16) All (3-15)\n"
+" 17) Quit\n"));
} else {
- printf(_("\n\
- 1) Toggle modify database flag\n\
- 2) Toggle verbose flag\n\
- 3) Check for bad Filename records\n\
- 4) Check for bad Path records\n\
- 5) Check for duplicate Filename records\n\
- 6) Check for duplicate Path records\n\
- 7) Check for orphaned Jobmedia records\n\
- 8) Check for orphaned File records\n\
- 9) Check for orphaned Path records\n\
- 10) Check for orphaned Filename records\n\
- 11) Check for orphaned FileSet records\n\
- 12) Check for orphaned Client records\n\
- 13) Check for orphaned Job records\n\
- 14) Check for all Admin records\n\
- 15) Check for all Restore records\n\
- 16) All (3-15)\n\
- 17) Quit\n"));
+ printf(_("\n"
+" 1) Toggle modify database flag\n"
+" 2) Toggle verbose flag\n"
+" 3) Check for bad Filename records\n"
+" 4) Check for bad Path records\n"
+" 5) Check for duplicate Filename records\n"
+" 6) Check for duplicate Path records\n"
+" 7) Check for orphaned Jobmedia records\n"
+" 8) Check for orphaned File records\n"
+" 9) Check for orphaned Path records\n"
+" 10) Check for orphaned Filename records\n"
+" 11) Check for orphaned FileSet records\n"
+" 12) Check for orphaned Client records\n"
+" 13) Check for orphaned Job records\n"
+" 14) Check for all Admin records\n"
+" 15) Check for all Restore records\n"
+" 16) All (3-15)\n"
+" 17) Quit\n"));
}
cmd = get_cmd(_("Select function number: "));
switch (item) {
case 1:
fix = !fix;
- printf(_("Database will %sbe modified.\n"), fix?"":_("NOT "));
+ printf(_("Database will %sbe modified.\n"), fix?"":_("NOT "));
break;
case 2:
verbose = verbose?0:1;
- printf(_("Verbose is %s\n"), verbose?_("On"):_("Off"));
+ printf(_("Verbose is %s\n"), verbose?_("On"):_("Off"));
break;
case 3:
repair_bad_filenames();
static int print_job_handler(void *ctx, int num_fields, char **row)
{
- printf(_("JobId=%s Name=\"%s\" StartTime=%s\n"),
+ printf(_("JobId=%s Name=\"%s\" StartTime=%s\n"),
NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
return 0;
}
static int print_jobmedia_handler(void *ctx, int num_fields, char **row)
{
- printf(_("Orphaned JobMediaId=%s JobId=%s Volume=\"%s\"\n"),
+ printf(_("Orphaned JobMediaId=%s JobId=%s Volume=\"%s\"\n"),
NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
return 0;
}
static int print_file_handler(void *ctx, int num_fields, char **row)
{
- printf(_("Orphaned FileId=%s JobId=%s Volume=\"%s\"\n"),
+ printf(_("Orphaned FileId=%s JobId=%s Volume=\"%s\"\n"),
NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
return 0;
}
static int print_fileset_handler(void *ctx, int num_fields, char **row)
{
- printf(_("Orphaned FileSetId=%s FileSet=\"%s\" MD5=%s\n"),
+ printf(_("Orphaned FileSetId=%s FileSet=\"%s\" MD5=%s\n"),
NPRT(row[0]), NPRT(row[1]), NPRT(row[2]));
return 0;
}
static int print_client_handler(void *ctx, int num_fields, char **row)
{
- printf(_("Orphaned ClientId=%s Name=\"%s\"\n"),
+ printf(_("Orphaned ClientId=%s Name=\"%s\"\n"),
NPRT(row[0]), NPRT(row[1]));
return 0;
}
-
+
/*
* Called here with each id to be added to the list
*/
{
ID_LIST *lst = (ID_LIST *)ctx;
- if (lst->num_ids == MAX_ID_LIST_LEN) {
+ if (lst->num_ids == MAX_ID_LIST_LEN) {
return 1;
}
if (lst->num_ids == lst->max_ids) {
}
/*
- * Delete all entries in the list
+ * Delete all entries in the list
*/
static int delete_id_list(const char *query, ID_LIST *id_list)
-{
+{
for (int i=0; i < id_list->num_ids; i++) {
bsnprintf(buf, sizeof(buf), query, id_list->Id[i]);
if (verbose) {
- printf("Deleting: %s\n", buf);
+ printf("Deleting: %s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
}
{
NAME_LIST *name = (NAME_LIST *)ctx;
- if (name->num_ids == MAX_ID_LIST_LEN) {
+ if (name->num_ids == MAX_ID_LIST_LEN) {
return 1;
}
if (name->num_ids == name->max_ids) {
* Print names in the list
*/
static void print_name_list(NAME_LIST *name_list)
-{
+{
for (int i=0; i < name_list->num_ids; i++) {
printf("%s\n", name_list->name[i]);
}
* Free names in the list
*/
static void free_name_list(NAME_LIST *name_list)
-{
+{
for (int i=0; i < name_list->num_ids; i++) {
free(name_list->name[i]);
}
char esc_name[5000];
printf("Checking for duplicate Filename entries.\n");
-
+
/* Make list of duplicated names */
query = "SELECT Name, count(Name) as Count FROM Filename GROUP BY Name "
- "HAVING count(Name) > 1";
+ "HAVING count(Name) > 1";
if (!make_name_list(query, &name_list)) {
exit(1);
for (int i=0; i<name_list.num_ids; i++) {
/* Get all the Ids of each name */
db_escape_string(esc_name, name_list.name[i], strlen(name_list.name[i]));
- bsnprintf(buf, sizeof(buf), "SELECT FilenameId FROM Filename WHERE Name='%s'", esc_name);
+ bsnprintf(buf, sizeof(buf), "SELECT FilenameId FROM Filename WHERE Name='%s'", esc_name);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
if (!make_id_list(buf, &id_list)) {
exit(1);
}
if (verbose) {
- printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
+ printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
}
/* Force all records to use the first id then delete the other ids */
for (int j=1; j<id_list.num_ids; j++) {
- bsnprintf(buf, sizeof(buf), "UPDATE File SET FilenameId=%u WHERE FilenameId=%u",
+ bsnprintf(buf, sizeof(buf), "UPDATE File SET FilenameId=%u WHERE FilenameId=%u",
id_list.Id[0], id_list.Id[j]);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
- bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%u",
+ bsnprintf(buf, sizeof(buf), "DELETE FROM Filename WHERE FilenameId=%u",
id_list.Id[j]);
if (verbose > 2) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
}
char esc_name[5000];
printf(_("Checking for duplicate Path entries.\n"));
-
+
/* Make list of duplicated names */
query = "SELECT Path, count(Path) as Count FROM Path "
- "GROUP BY Path HAVING count(Path) > 1";
+ "GROUP BY Path HAVING count(Path) > 1";
if (!make_name_list(query, &name_list)) {
exit(1);
for (int i=0; i<name_list.num_ids; i++) {
/* Get all the Ids of each name */
db_escape_string(esc_name, name_list.name[i], strlen(name_list.name[i]));
- bsnprintf(buf, sizeof(buf), "SELECT PathId FROM Path WHERE Path='%s'", esc_name);
+ bsnprintf(buf, sizeof(buf), "SELECT PathId FROM Path WHERE Path='%s'", esc_name);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
if (!make_id_list(buf, &id_list)) {
exit(1);
}
if (verbose) {
- printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
+ printf("Found %d for: %s\n", id_list.num_ids, name_list.name[i]);
}
/* Force all records to use the first id then delete the other ids */
for (int j=1; j<id_list.num_ids; j++) {
- bsnprintf(buf, sizeof(buf), "UPDATE File SET PathId=%u WHERE PathId=%u",
+ bsnprintf(buf, sizeof(buf), "UPDATE File SET PathId=%u WHERE PathId=%u",
id_list.Id[0], id_list.Id[j]);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
- bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%u",
+ bsnprintf(buf, sizeof(buf), "DELETE FROM Path WHERE PathId=%u",
id_list.Id[j]);
if (verbose > 2) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
}
printf("Checking for orphaned JobMedia entries.\n");
query = "SELECT JobMedia.JobMediaId,Job.JobId FROM JobMedia "
- "LEFT OUTER JOIN Job ON (JobMedia.JobId=Job.JobId) "
- "WHERE Job.JobId IS NULL";
+ "LEFT OUTER JOIN Job ON (JobMedia.JobId=Job.JobId) "
+ "WHERE Job.JobId IS NULL";
if (!make_id_list(query, &id_list)) {
exit(1);
}
printf("Found %d orphaned JobMedia records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf),
+ bsnprintf(buf, sizeof(buf),
"SELECT JobMedia.JobMediaId,JobMedia.JobId,Media.VolumeName FROM JobMedia,Media "
"WHERE JobMedia.JobMediaId=%u AND Media.MediaId=JobMedia.MediaId", id_list.Id[i]);
if (!db_sql_query(db, buf, print_jobmedia_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned JobMedia records.\n", id_list.num_ids);
delete_id_list("DELETE FROM JobMedia WHERE JobMediaId=%u", &id_list);
printf("Checking for orphaned File entries. This may take some time!\n");
query = "SELECT File.FileId,Job.JobId FROM File "
- "LEFT OUTER JOIN Job ON (File.JobId=Job.JobId) "
- "WHERE Job.JobId IS NULL";
+ "LEFT OUTER JOIN Job ON (File.JobId=Job.JobId) "
+ "WHERE Job.JobId IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
"SELECT File.FileId,File.JobId,Filename.Name FROM File,Filename "
"WHERE File.FileId=%u AND File.FilenameId=Filename.FilenameId", id_list.Id[i]);
if (!db_sql_query(db, buf, print_file_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned File records.\n", id_list.num_ids);
delete_id_list("DELETE FROM File WHERE FileId=%u", &id_list);
printf("Checking for orphaned Path entries. This may take some time!\n");
query = "SELECT DISTINCT Path.PathId,File.PathId FROM Path "
- "LEFT OUTER JOIN File ON (Path.PathId=File.PathId) "
- "WHERE File.PathId IS NULL";
+ "LEFT OUTER JOIN File ON (Path.PathId=File.PathId) "
+ "WHERE File.PathId IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d orphaned Path records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
db_sql_query(db, buf, print_name_handler, NULL);
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned Path records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Path WHERE PathId=%u", &id_list);
printf("Checking for orphaned Filename entries. This may take some time!\n");
query = "SELECT Filename.FilenameId,File.FilenameId FROM Filename "
- "LEFT OUTER JOIN File ON (Filename.FilenameId=File.FilenameId) "
- "WHERE File.FilenameId IS NULL";
+ "LEFT OUTER JOIN File ON (Filename.FilenameId=File.FilenameId) "
+ "WHERE File.FilenameId IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d orphaned Filename records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
db_sql_query(db, buf, print_name_handler, NULL);
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned Filename records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Filename WHERE FilenameId=%u", &id_list);
printf("Checking for orphaned FileSet entries. This takes some time!\n");
query = "SELECT FileSet.FileSetId,Job.FileSetId FROM FileSet "
- "LEFT OUTER JOIN Job ON (FileSet.FileSetId=Job.FileSetId) "
- "WHERE Job.FileSetId IS NULL";
+ "LEFT OUTER JOIN Job ON (FileSet.FileSetId=Job.FileSetId) "
+ "WHERE Job.FileSetId IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d orphaned FileSet records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT FileSetId,FileSet,MD5 FROM FileSet "
- "WHERE FileSetId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT FileSetId,FileSet,MD5 FROM FileSet "
+ "WHERE FileSetId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_fileset_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned FileSet records.\n", id_list.num_ids);
delete_id_list("DELETE FROM FileSet WHERE FileSetId=%u", &id_list);
* i.e. Job.Client is NULL
*/
query = "SELECT Client.ClientId,Client.Name FROM Client "
- "LEFT OUTER JOIN Job ON (Client.ClientId=Job.ClientId) "
- "WHERE Job.ClientId IS NULL";
+ "LEFT OUTER JOIN Job ON (Client.ClientId=Job.ClientId) "
+ "WHERE Job.ClientId IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d orphaned Client records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT ClientId,Name FROM Client "
- "WHERE ClientId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT ClientId,Name FROM Client "
+ "WHERE ClientId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_client_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned Client records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Client WHERE ClientId=%u", &id_list);
* i.e. Client.Name is NULL
*/
query = "SELECT Job.JobId,Job.Name FROM Job "
- "LEFT OUTER JOIN Client ON (Job.ClientId=Client.ClientId) "
- "WHERE Client.Name IS NULL";
+ "LEFT OUTER JOIN Client ON (Job.ClientId=Client.ClientId) "
+ "WHERE Client.Name IS NULL";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d orphaned Job records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
- "WHERE JobId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+ "WHERE JobId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_job_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d orphaned Job records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
printf("Checking for Admin Job entries.\n");
query = "SELECT Job.JobId FROM Job "
- "WHERE Job.Type='D'";
+ "WHERE Job.Type='D'";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d Admin Job records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
- "WHERE JobId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+ "WHERE JobId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_job_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d Admin Job records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
printf("Checking for Restore Job entries.\n");
query = "SELECT Job.JobId FROM Job "
- "WHERE Job.Type='R'";
+ "WHERE Job.Type='R'";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d Restore Job records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (int i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
- "WHERE JobId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf), "SELECT JobId,Name,StartTime FROM Job "
+ "WHERE JobId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_job_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
printf("Deleting %d Restore Job records.\n", id_list.num_ids);
delete_id_list("DELETE FROM Job WHERE JobId=%u", &id_list);
printf("Checking for Filenames with a trailing slash\n");
query = "SELECT FilenameId,Name from Filename "
- "WHERE Name LIKE '%/'";
+ "WHERE Name LIKE '%/'";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d bad Filename records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf),
- "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf),
+ "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_name_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
printf("Reparing %d bad Filename records.\n", id_list.num_ids);
for (i=0; i < id_list.num_ids; i++) {
int len;
- bsnprintf(buf, sizeof(buf),
- "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf),
+ "SELECT Name FROM Filename WHERE FilenameId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, get_name_handler, name)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
/* Strip trailing slash(es) */
- for (len=strlen(name); len > 0 && name[len-1]=='/'; len--)
+ for (len=strlen(name); len > 0 && name[len-1]=='/'; len--)
{ }
if (len == 0) {
len = 1;
- esc_name[0] = ' ';
+ esc_name[0] = ' ';
esc_name[1] = 0;
} else {
name[len-1] = 0;
db_escape_string(esc_name, name, len);
}
- bsnprintf(buf, sizeof(buf),
- "UPDATE Filename SET Name='%s' WHERE FilenameId=%u",
+ bsnprintf(buf, sizeof(buf),
+ "UPDATE Filename SET Name='%s' WHERE FilenameId=%u",
esc_name, id_list.Id[i]);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
}
printf("Checking for Paths without a trailing slash\n");
query = "SELECT PathId,Path from Path "
- "WHERE Path NOT LIKE '%/'";
+ "WHERE Path NOT LIKE '%/'";
if (verbose > 1) {
printf("%s\n", query);
}
printf("Found %d bad Path records.\n", id_list.num_ids);
if (id_list.num_ids && verbose && yes_no("Print them? (yes/no): ")) {
for (i=0; i < id_list.num_ids; i++) {
- bsnprintf(buf, sizeof(buf),
- "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf),
+ "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, print_name_handler, NULL)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
}
}
-
+
if (fix && id_list.num_ids > 0) {
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
printf("Reparing %d bad Filename records.\n", id_list.num_ids);
for (i=0; i < id_list.num_ids; i++) {
int len;
- bsnprintf(buf, sizeof(buf),
- "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
+ bsnprintf(buf, sizeof(buf),
+ "SELECT Path FROM Path WHERE PathId=%u", id_list.Id[i]);
if (!db_sql_query(db, buf, get_name_handler, name)) {
- printf("%s\n", db_strerror(db));
+ printf("%s\n", db_strerror(db));
}
/* Strip trailing blanks */
- for (len=strlen(name); len > 0 && name[len-1]==' '; len--) {
+ for (len=strlen(name); len > 0 && name[len-1]==' '; len--) {
name[len-1] = 0;
}
/* Add trailing slash */
- len = pm_strcat(&name, "/");
+ len = pm_strcat(&name, "/");
db_escape_string(esc_name, name, len);
- bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%u",
+ bsnprintf(buf, sizeof(buf), "UPDATE Path SET Path='%s' WHERE PathId=%u",
esc_name, id_list.Id[i]);
if (verbose > 1) {
- printf("%s\n", buf);
+ printf("%s\n", buf);
}
db_sql_query(db, buf, NULL, NULL);
}
static int yes_no(const char *prompt)
{
- char *cmd;
+ char *cmd;
cmd = get_cmd(prompt);
return strcasecmp(cmd, "yes") == 0;
}
--- /dev/null
+/*
+ * Program for determining file system type
+ *
+ * Written by Preben 'Peppe' Guldberg, December MMIV
+ *
+ * Version $Id$
+ *
+ */
+
+/*
+ Copyright (C) 2004 Kern Sibbald
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+#include "bacula.h"
+#include "findlib/find.h"
+
+static void usage()
+{
+ fprintf(stderr, _(
+"\n"
+"Usage: fstype [-d debug_level] path ...\n"
+"\n"
+" Print the file system type a given file/directory is on.\n"
+" The following options are supported:\n"
+"\n"
+" -v print both path and file system type.\n"
+" -? print this message.\n"
+"\n"));
+
+ exit(1);
+}
+
+
+int
+main (int argc, char *const *argv)
+{
+ char fs[1000];
+ int verbose = 0;
+ int status = 0;
+ int ch, i;
+
+ while ((ch = getopt(argc, argv, "v?")) != -1) {
+ switch (ch) {
+ case 'v':
+ verbose = 1;
+ break;
+ case '?':
+ default:
+ usage();
+
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc < 1) {
+ usage();
+ }
+
+ for (i = 0; i < argc; --argc, ++argv) {
+ if (fstype(*argv, fs, sizeof(fs))) {
+ if (verbose) {
+ printf("%s: %s\n", *argv, fs);
+ } else {
+ puts(fs);
+ }
+ } else {
+ fprintf(stderr, "%s: unknown\n", *argv);
+ status = 1;
+ }
+ }
+
+ exit(status);
+}
-/*
+/*
* Test program for find files
*/
while ((ch = getopt(argc, argv, "ad:e:i:?")) != -1) {
switch (ch) {
- case 'a': /* print extended attributes *debug* */
+ case 'a': /* print extended attributes *debug* */
attrs = 1;
break;
- case 'd': /* set debug level */
+ case 'd': /* set debug level */
debug_level = atoi(optarg);
if (debug_level <= 0) {
- debug_level = 1;
+ debug_level = 1;
}
break;
- case 'e': /* exclude patterns */
+ case 'e': /* exclude patterns */
exc = optarg;
break;
- case 'i': /* include patterns */
+ case 'i': /* include patterns */
inc = optarg;
break;
- case '?':
+ case '?':
default:
usage();
- }
+ }
}
argc -= optind;
argv += optind;
ff = init_find_files();
if (argc == 0 && !inc) {
add_fname_to_include_list(ff, 0, "/"); /* default to / */
- } else {
+ } else {
for (i=0; i < argc; i++) {
- if (strcmp(argv[i], "-") == 0) {
+ if (strcmp(argv[i], "-") == 0) {
while (fgets(name, sizeof(name)-1, stdin)) {
strip_trailing_junk(name);
- add_fname_to_include_list(ff, 0, name);
+ add_fname_to_include_list(ff, 0, name);
}
continue;
}
- add_fname_to_include_list(ff, 0, argv[i]);
+ add_fname_to_include_list(ff, 0, argv[i]);
}
}
if (inc) {
fd = fopen(inc, "r");
if (!fd) {
- printf("Could not open include file: %s\n", inc);
+ printf("Could not open include file: %s\n", inc);
exit(1);
}
while (fgets(name, sizeof(name)-1, fd)) {
if (exc) {
fd = fopen(exc, "r");
if (!fd) {
- printf("Could not open exclude file: %s\n", exc);
+ printf("Could not open exclude file: %s\n", exc);
exit(1);
}
while (fgets(name, sizeof(name)-1, fd)) {
}
find_files(jcr, ff, print_file, NULL);
hard_links = term_find_files(ff);
-
- printf(_("\
-Total files : %d\n\
-Max file length: %d\n\
-Max path length: %d\n\
-Files truncated: %d\n\
-Paths truncated: %d\n\
-Hard links : %d\n"),
+
+ printf(_(""
+"Total files : %d\n"
+"Max file length: %d\n"
+"Max path length: %d\n"
+"Files truncated: %d\n"
+"Paths truncated: %d\n"
+"Hard links : %d\n"),
num_files, max_file_len, max_path_len,
trunc_fname, trunc_path, hard_links);
-
+
free_jcr(jcr);
close_memory_pool();
sm_dump(false);
switch (ff->type) {
case FT_LNKSAVED:
if (debug_level == 1) {
- printf("%s\n", ff->fname);
+ printf("%s\n", ff->fname);
} else if (debug_level > 1) {
- printf("Lnka: %s -> %s\n", ff->fname, ff->link);
+ printf("Lnka: %s -> %s\n", ff->fname, ff->link);
}
break;
case FT_REGE:
if (debug_level == 1) {
- printf("%s\n", ff->fname);
+ printf("%s\n", ff->fname);
} else if (debug_level > 1) {
- printf("Empty: %s\n", ff->fname);
+ printf("Empty: %s\n", ff->fname);
}
count_files(ff);
- break;
+ break;
case FT_REG:
if (debug_level == 1) {
- printf("%s\n", ff->fname);
+ printf("%s\n", ff->fname);
} else if (debug_level > 1) {
- printf("Reg: %s\n", ff->fname);
+ printf("Reg: %s\n", ff->fname);
}
count_files(ff);
break;
case FT_LNK:
if (debug_level == 1) {
- printf("%s\n", ff->fname);
+ printf("%s\n", ff->fname);
} else if (debug_level > 1) {
- printf("Lnk: %s -> %s\n", ff->fname, ff->link);
+ printf("Lnk: %s -> %s\n", ff->fname, ff->link);
}
count_files(ff);
break;
case FT_DIRBEGIN:
return 1;
+ case FT_NORECURSE:
+ case FT_NOFSCHG:
+ case FT_INVALIDFS:
case FT_DIREND:
- if (debug_level == 1) {
- printf("%s\n", ff->fname);
- } else if (debug_level > 1) {
- printf("Dir: %s\n", ff->fname);
+ if (debug_level) {
+ char errmsg[100] = "";
+ if (ff->type == FT_NORECURSE) {
+ bstrncpy(errmsg, "\t[will not descend: recursion turned off]", sizeof(errmsg));
+ } else if (ff->type == FT_NOFSCHG) {
+ bstrncpy(errmsg, "\t[will not descend: file system change not allowed]", sizeof(errmsg));
+ } else if (ff->type == FT_INVALIDFS) {
+ bstrncpy(errmsg, "\t[will not descend: disallowed file system]", sizeof(errmsg));
+ }
+ printf("%s%s%s\n", (debug_level > 1 ? "Dir: " : ""), ff->fname, errmsg);
}
+ ff->type = FT_DIREND;
count_files(ff);
break;
case FT_SPEC:
if (debug_level == 1) {
- printf("%s\n", ff->fname);
+ printf("%s\n", ff->fname);
} else if (debug_level > 1) {
- printf("Spec: %s\n", ff->fname);
+ printf("Spec: %s\n", ff->fname);
}
count_files(ff);
break;
case FT_ISARCH:
printf(_("Err: Attempt to backup archive. Not saved. %s\n"), ff->fname);
break;
- case FT_NORECURSE:
- printf(_("Recursion turned off. Directory not entered. %s\n"), ff->fname);
- break;
- case FT_NOFSCHG:
- printf(_("Skip: File system change prohibited. Directory not entered. %s\n"), ff->fname);
- break;
case FT_NOOPEN:
printf(_("Err: Could not open directory %s: %s\n"), ff->fname, strerror(errno));
break;
char attr[200];
encode_attribsEx(NULL, attr, ff);
if (*attr != 0) {
- printf("AttrEx=%s\n", attr);
+ printf("AttrEx=%s\n", attr);
}
// set_attribsEx(NULL, ff->fname, NULL, NULL, ff->type, attr);
}
return 1;
}
-static void count_files(FF_PKT *ar)
+static void count_files(FF_PKT *ar)
{
int fnl, pnl;
char *l, *p;
num_files++;
- /* Find path without the filename.
+ /* Find path without the filename.
* I.e. everything after the last / is a "filename".
* OK, maybe it is a directory name, but we treat it like
* a filename. If we don't find a / then the whole name
}
/* If filename doesn't exist (i.e. root directory), we
- * simply create a blank name consisting of a single
+ * simply create a blank name consisting of a single
* space. This makes handling zero length filenames
* easier.
*/
file[1] = 0;
}
- pnl = l - ar->fname;
+ pnl = l - ar->fname;
if (pnl > max_path_len) {
max_path_len = pnl;
}
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
*/
#include "jcr.h"
void senditf(const char *fmt, ...);
-void sendit(const char *buf);
+void sendit(const char *buf);
/* Commands sent to Director */
static char DIRhello[] = "Hello %s calling\n";
bstrncpy(bashed_name, mon->hdr.name, sizeof(bashed_name));
bash_spaces(bashed_name);
password = mon->password;
-
+
/* Timeout Hello after 5 mins */
btimer_t *tid = start_bsock_timer(dir, 60 * 5);
bnet_fsend(dir, DIRhello, bashed_name);
- if (!cram_md5_get_auth(dir, password, ssl_need) ||
+ if (!cram_md5_get_auth(dir, password, ssl_need) ||
!cram_md5_auth(dir, password, ssl_need)) {
stop_bsock_timer(tid);
Jmsg0(jcr, M_FATAL, 0, _("Director authorization problem.\n"
- "Most likely the passwords do not agree.\n"
+ "Most likely the passwords do not agree.\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
return 0;
}
char dirname[MAX_NAME_LENGTH];
int ssl_need = BNET_SSL_NONE;
- /*
+ /*
* Send my name to the Storage daemon then do authentication
*/
bstrncpy(dirname, monitor->hdr.name, sizeof(dirname));
Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to Storage daemon. ERR=%s\n"), bnet_strerror(sd));
return 0;
}
- if (!cram_md5_get_auth(sd, store->password, ssl_need) ||
+ if (!cram_md5_get_auth(sd, store->password, ssl_need) ||
!cram_md5_auth(sd, store->password, ssl_need)) {
stop_bsock_timer(tid);
- Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords or names not the same.\n"
+ Jmsg0(jcr, M_FATAL, 0, _("Director and Storage daemon passwords or names not the same.\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
return 0;
}
char dirname[MAX_NAME_LENGTH];
int ssl_need = BNET_SSL_NONE;
- /*
+ /*
* Send my name to the File daemon then do authentication
*/
bstrncpy(dirname, monitor->hdr.name, sizeof(dirname));
Jmsg(jcr, M_FATAL, 0, _("Error sending Hello to File daemon. ERR=%s\n"), bnet_strerror(fd));
return 0;
}
- if (!cram_md5_get_auth(fd, client->password, ssl_need) ||
+ if (!cram_md5_get_auth(fd, client->password, ssl_need) ||
!cram_md5_auth(fd, client->password, ssl_need)) {
stop_bsock_timer(tid);
- Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords or names not the same.\n"
+ Jmsg(jcr, M_FATAL, 0, _("Director and File daemon passwords or names not the same.\n"
"Please see http://www.bacula.org/html-manual/faq.html#AuthorizationErrors for help.\n"));
return 0;
}
/* VOID:OBJECT,OBJECT (eggmarshalers.list:1) */
void
_egg_marshal_VOID__OBJECT_OBJECT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__OBJECT_OBJECT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_object (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_object (param_values + 2),
+ data2);
}
/* VOID:OBJECT,STRING,LONG,LONG (eggmarshalers.list:2) */
void
_egg_marshal_VOID__OBJECT_STRING_LONG_LONG (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- glong arg_3,
- glong arg_4,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ glong arg_3,
+ glong arg_4,
+ gpointer data2);
register GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__OBJECT_STRING_LONG_LONG) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_long (param_values + 3),
- g_marshal_value_peek_long (param_values + 4),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_long (param_values + 3),
+ g_marshal_value_peek_long (param_values + 4),
+ data2);
}
/* VOID:OBJECT,LONG (eggmarshalers.list:3) */
void
_egg_marshal_VOID__OBJECT_LONG (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_LONG) (gpointer data1,
- gpointer arg_1,
- glong arg_2,
- gpointer data2);
+ gpointer arg_1,
+ glong arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__OBJECT_LONG callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__OBJECT_LONG) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_long (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_long (param_values + 2),
+ data2);
}
/* VOID:OBJECT,STRING,STRING (eggmarshalers.list:4) */
void
_egg_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_STRING_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer data2);
register GMarshalFunc_VOID__OBJECT_STRING_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ data2);
}
/* VOID:UINT,UINT (eggmarshalers.list:5) */
void
_egg_marshal_VOID__UINT_UINT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer data1,
- guint arg_1,
- guint arg_2,
- gpointer data2);
+ guint arg_1,
+ guint arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__UINT_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_uint (param_values + 1),
- g_marshal_value_peek_uint (param_values + 2),
- data2);
+ g_marshal_value_peek_uint (param_values + 1),
+ g_marshal_value_peek_uint (param_values + 2),
+ data2);
}
/* BOOLEAN:INT (eggmarshalers.list:6) */
void
_egg_marshal_BOOLEAN__INT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__INT) (gpointer data1,
- gint arg_1,
- gpointer data2);
+ gint arg_1,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__INT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__INT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_int (param_values + 1),
- data2);
+ g_marshal_value_peek_int (param_values + 1),
+ data2);
g_value_set_boolean (return_value, v_return);
}
/* BOOLEAN:ENUM (eggmarshalers.list:7) */
void
_egg_marshal_BOOLEAN__ENUM (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__ENUM) (gpointer data1,
- gint arg_1,
- gpointer data2);
+ gint arg_1,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__ENUM callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__ENUM) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_enum (param_values + 1),
- data2);
+ g_marshal_value_peek_enum (param_values + 1),
+ data2);
g_value_set_boolean (return_value, v_return);
}
/* BOOLEAN:VOID (eggmarshalers.list:8) */
void
_egg_marshal_BOOLEAN__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1,
- gpointer data2);
+ gpointer data2);
register GMarshalFunc_BOOLEAN__VOID callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- data2);
+ data2);
g_value_set_boolean (return_value, v_return);
}
/* OBJECT:VOID (eggmarshalers.list:9) */
void
_egg_marshal_OBJECT__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef GObject* (*GMarshalFunc_OBJECT__VOID) (gpointer data1,
- gpointer data2);
+ gpointer data2);
register GMarshalFunc_OBJECT__VOID callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_OBJECT__VOID) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- data2);
+ data2);
g_value_set_object_take_ownership (return_value, v_return);
}
/* VOID:INT,INT (eggmarshalers.list:11) */
void
_egg_marshal_VOID__INT_INT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1,
- gint arg_1,
- gint arg_2,
- gpointer data2);
+ gint arg_1,
+ gint arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__INT_INT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_int (param_values + 1),
- g_marshal_value_peek_int (param_values + 2),
- data2);
+ g_marshal_value_peek_int (param_values + 1),
+ g_marshal_value_peek_int (param_values + 2),
+ data2);
}
/* VOID:UINT,UINT (eggmarshalers.list:12) */
/* VOID:OBJECT,ENUM,BOXED (eggmarshalers.list:14) */
void
_egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__OBJECT_ENUM_BOXED) (gpointer data1,
- gpointer arg_1,
- gint arg_2,
- gpointer arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gint arg_2,
+ gpointer arg_3,
+ gpointer data2);
register GMarshalFunc_VOID__OBJECT_ENUM_BOXED callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__OBJECT_ENUM_BOXED) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_enum (param_values + 2),
- g_marshal_value_peek_boxed (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_enum (param_values + 2),
+ g_marshal_value_peek_boxed (param_values + 3),
+ data2);
}
/* VOID:BOXED (eggmarshalers.list:15) */
/* BOOLEAN:BOOLEAN (eggmarshalers.list:16) */
void
_egg_marshal_BOOLEAN__BOOLEAN (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN) (gpointer data1,
- gboolean arg_1,
- gpointer data2);
+ gboolean arg_1,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__BOOLEAN callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__BOOLEAN) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_boolean (param_values + 1),
- data2);
+ g_marshal_value_peek_boolean (param_values + 1),
+ data2);
g_value_set_boolean (return_value, v_return);
}
/* BOOLEAN:OBJECT,STRING,STRING (eggmarshalers.list:17) */
void
_egg_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ data2);
g_value_set_boolean (return_value, v_return);
}
/* VOID:OBJECT,OBJECT (eggmarshalers.list:1) */
extern void _egg_marshal_VOID__OBJECT_OBJECT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:OBJECT,STRING,LONG,LONG (eggmarshalers.list:2) */
extern void _egg_marshal_VOID__OBJECT_STRING_LONG_LONG (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:OBJECT,LONG (eggmarshalers.list:3) */
extern void _egg_marshal_VOID__OBJECT_LONG (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:OBJECT,STRING,STRING (eggmarshalers.list:4) */
extern void _egg_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:UINT,UINT (eggmarshalers.list:5) */
extern void _egg_marshal_VOID__UINT_UINT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* BOOLEAN:INT (eggmarshalers.list:6) */
extern void _egg_marshal_BOOLEAN__INT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* BOOLEAN:ENUM (eggmarshalers.list:7) */
extern void _egg_marshal_BOOLEAN__ENUM (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* BOOLEAN:VOID (eggmarshalers.list:8) */
extern void _egg_marshal_BOOLEAN__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* OBJECT:VOID (eggmarshalers.list:9) */
extern void _egg_marshal_OBJECT__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:VOID (eggmarshalers.list:10) */
#define _egg_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID
/* VOID:INT,INT (eggmarshalers.list:11) */
extern void _egg_marshal_VOID__INT_INT (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:UINT,UINT (eggmarshalers.list:12) */
/* VOID:OBJECT,ENUM,BOXED (eggmarshalers.list:14) */
extern void _egg_marshal_VOID__OBJECT_ENUM_BOXED (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:BOXED (eggmarshalers.list:15) */
#define _egg_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED
/* BOOLEAN:BOOLEAN (eggmarshalers.list:16) */
extern void _egg_marshal_BOOLEAN__BOOLEAN (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* BOOLEAN:OBJECT,STRING,STRING (eggmarshalers.list:17) */
extern void _egg_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
G_END_DECLS
GdkEventButton *event);
static void egg_status_icon_disable_blinking (EggStatusIcon *status_icon);
static void egg_status_icon_reset_image_data (EggStatusIcon *status_icon);
-
+
static GObjectClass *parent_class = NULL;
static guint status_icon_signals [LAST_SIGNAL] = { 0 };
egg_status_icon_get_type (void)
{
static GType status_icon_type = 0;
-
+
if (!status_icon_type)
{
static const GTypeInfo status_icon_info =
0, /* n_preallocs */
(GInstanceInitFunc) egg_status_icon_init,
};
-
+
status_icon_type = g_type_register_static (G_TYPE_OBJECT,
"EggStatusIcon",
&status_icon_info, (GTypeFlags)0);
}
-
+
return status_icon_type;
}
"Stock ID for a stock image to display",
NULL,
(GParamFlags)G_PARAM_READWRITE));
-
+
g_object_class_install_property (gobject_class,
PROP_PIXBUF_ANIMATION,
g_param_spec_object ("pixbuf-animation",
"GdkPixbufAnimation to display",
GDK_TYPE_PIXBUF_ANIMATION,
(GParamFlags)G_PARAM_READWRITE));
-
+
g_object_class_install_property (gobject_class,
PROP_STORAGE_TYPE,
g_param_spec_enum ("image-type",
gint size)
{
gboolean handled = FALSE;
-
+
g_signal_emit (status_icon,
status_icon_signals [SIZE_CHANGED_SIGNAL], 0,
size,
height = gdk_pixbuf_get_width (status_icon->priv->blank_icon);
if (width == status_icon->priv->size &&
- height == status_icon->priv->size)
+ height == status_icon->priv->size)
{
return status_icon->priv->blank_icon;
}
g_return_if_fail (EGG_IS_STATUS_ICON (status_icon));
g_return_if_fail (animation == NULL || GDK_IS_PIXBUF_ANIMATION (animation));
}
-
+
GtkImageType
egg_status_icon_get_image_type (EggStatusIcon *status_icon)
{
return status_icon->priv->image_type;
}
-
+
GdkPixbuf *
egg_status_icon_get_pixbuf (EggStatusIcon *status_icon)
{
g_return_val_if_fail (EGG_IS_STATUS_ICON (status_icon), NULL);
g_return_val_if_fail (status_icon->priv->image_type == GTK_IMAGE_PIXBUF ||
status_icon->priv->image_type == GTK_IMAGE_EMPTY, NULL);
-
+
if (status_icon->priv->image_type == GTK_IMAGE_EMPTY)
status_icon->priv->image_data.pixbuf = NULL;
-
+
return status_icon->priv->image_data.pixbuf;
}
return NULL;
}
-
+
gint
egg_status_icon_get_size (EggStatusIcon *status_icon)
{
return status_icon->priv->size;
}
-
+
void
egg_status_icon_set_tooltip (EggStatusIcon *status_icon,
const gchar *tooltip_text,
egg_status_icon_get_tray_icon (EggStatusIcon *status_icon)
{
g_return_val_if_fail (EGG_IS_STATUS_ICON (status_icon), NULL);
-
+
return EGG_TRAY_ICON(status_icon->priv->tray_icon);
}
#define EGG_IS_STATUS_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EGG_TYPE_STATUS_ICON))
#define EGG_IS_STATUS_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EGG_TYPE_STATUS_ICON))
#define EGG_STATUS_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EGG_TYPE_STATUS_ICON, EggStatusIconClass))
-
+
typedef struct _EggStatusIcon EggStatusIcon;
typedef struct _EggStatusIconClass EggStatusIconClass;
typedef struct _EggStatusIconPrivate EggStatusIconPrivate;
*/
extern "C" {
-
+
#include <string.h>
#include <libintl.h>
PROP_0,
PROP_ORIENTATION
};
-
+
static GtkPlugClass *parent_class = NULL;
static void egg_tray_icon_init (EggTrayIcon *icon);
{
icon->stamp = 1;
icon->orientation = GTK_ORIENTATION_HORIZONTAL;
-
+
gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
}
int error, result;
g_assert (icon->manager_window != None);
-
+
xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
gdk_error_trap_push ();
egg_tray_icon_update_manager_window (icon);
}
}
-
+
return GDK_FILTER_CONTINUE;
}
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (widget),
- icon->manager_window);
+ icon->manager_window);
gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
}
{
XClientMessageEvent ev;
Display *display;
-
+
ev.type = ClientMessage;
ev.window = window;
ev.message_type = icon->system_tray_opcode_atom;
ev.data.l[4] = data3;
display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-
+
gdk_error_trap_push ();
XSendEvent (display,
icon->manager_window, False, NoEventMask, (XEvent *)&ev);
egg_tray_icon_update_manager_window (EggTrayIcon *icon)
{
Display *xdisplay;
-
+
xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-
+
if (icon->manager_window != None)
{
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
icon->manager_window);
-
+
gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
}
-
+
XGrabServer (xdisplay);
-
+
icon->manager_window = XGetSelectionOwner (xdisplay,
icon->selection_atom);
XUngrabServer (xdisplay);
XFlush (xdisplay);
-
+
if (icon->manager_window != None)
{
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
icon->manager_window);
-
+
gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
/* Send a request that we'd like to dock */
gdk_screen_get_number (screen));
icon->selection_atom = XInternAtom (xdisplay, buffer, False);
-
+
icon->manager_atom = XInternAtom (xdisplay, "MANAGER", False);
-
+
icon->system_tray_opcode_atom = XInternAtom (xdisplay,
"_NET_SYSTEM_TRAY_OPCODE",
False);
egg_tray_icon_update_manager_window (icon);
root_window = gdk_screen_get_root_window (screen);
-
+
/* Add a root window filter so that we get changes on MANAGER */
gdk_window_add_filter (root_window,
egg_tray_icon_manager_filter, icon);
gint len)
{
guint stamp;
-
+
g_return_val_if_fail (EGG_IS_TRAY_ICON (icon), 0);
g_return_val_if_fail (timeout >= 0, 0);
g_return_val_if_fail (message != NULL, 0);
-
+
if (icon->manager_window == None)
return 0;
len = strlen (message);
stamp = icon->stamp++;
-
+
/* Get ready to send the message */
egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_BEGIN_MESSAGE,
(Window)gtk_plug_get_id (GTK_PLUG (icon)),
Display *xdisplay;
xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
-
+
ev.type = ClientMessage;
ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
ev.format = 8;
{
g_return_if_fail (EGG_IS_TRAY_ICON (icon));
g_return_if_fail (id > 0);
-
+
egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_CANCEL_MESSAGE,
(Window)gtk_plug_get_id (GTK_PLUG (icon)),
id, 0, 0);
#define EGG_IS_TRAY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TRAY_ICON))
#define EGG_IS_TRAY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
#define EGG_TRAY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
-
+
typedef struct _EggTrayIcon EggTrayIcon;
typedef struct _EggTrayIconClass EggTrayIconClass;
GtkPlug parent_instance;
guint stamp;
-
+
Atom selection_atom;
Atom manager_atom;
Atom system_tray_opcode_atom;
guint id);
GtkOrientation egg_tray_icon_get_orientation (EggTrayIcon *icon);
-
+
G_END_DECLS
#endif /* __EGG_TRAY_ICON_H__ */
#include "generic.xpm"
+#define TRAY_DEBUG_MEMORY 0
+
/* Imported functions */
int authenticate_director(JCR *jcr, MONITOR *monitor, DIRRES *director);
int authenticate_file_daemon(JCR *jcr, MONITOR *monitor, CLIENT* client);
/* Static variables */
static char *configfile = NULL;
static MONITOR *monitor;
-static POOLMEM *args;
static JCR jcr;
static int nitems = 0;
static int fullitem = 0; //Item to be display in detailled status window
" -c <file> set configuration file to file\n"
" -dnn set debug level to nn\n"
" -t test - read configuration and exit\n"
-" -? print this message.\n"
+" -? print this message.\n"
"\n"), HOST_OS, DISTNAME, DISTVER);
}
-static GtkWidget *new_image_button(const gchar *stock_id,
- const gchar *label_text) {
+static GtkWidget *new_image_button(const gchar *stock_id,
+ const gchar *label_text) {
GtkWidget *button;
GtkWidget *box;
GtkWidget *label;
GtkWidget *image;
button = gtk_button_new();
-
+
box = gtk_hbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(box), 2);
image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_BUTTON);
label = gtk_label_new(label_text);
-
+
gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 3);
gtk_widget_show(box);
gtk_container_add(GTK_CONTAINER(button), box);
-
+
return button;
}
+int sm_line = 0;
+
+#if TRAY_DEBUG_MEMORY
+gpointer smt_malloc(gsize n_bytes) {
+ return sm_malloc("GLib", sm_line, n_bytes);
+}
+
+gpointer smt_realloc(gpointer mem, gsize n_bytes) {
+ return sm_realloc("GLib", sm_line, mem, n_bytes);
+}
+
+gpointer smt_calloc(gsize n_blocks,
+ gsize n_block_bytes) {
+ return sm_calloc("GLib", sm_line, n_blocks, n_block_bytes);
+}
+
+void smt_free(gpointer mem) {
+ sm_free("Glib", sm_line, mem);
+}
+#endif
+
/*********************************************************************
*
* Main Bacula Tray Monitor -- User Interface Program
*/
int main(int argc, char *argv[])
{
+#if TRAY_DEBUG_MEMORY
+ GMemVTable smvtable;
+ smvtable.malloc = &smt_malloc;
+ smvtable.realloc = &smt_realloc;
+ smvtable.free = &smt_free;
+ smvtable.calloc = &smt_calloc;
+ smvtable.try_malloc = NULL;
+ smvtable.try_realloc = NULL;
+ g_mem_set_vtable(&smvtable);
+#endif
+
int ch, i;
bool test_config = false;
DIRRES* dird;
textdomain("bacula");
init_msg(NULL, NULL);
working_directory = "/tmp";
- args = get_pool_memory(PM_FNAME);
struct sigaction sigignore;
sigignore.sa_flags = 0;
- sigignore.sa_handler = SIG_IGN;
+ sigignore.sa_handler = SIG_IGN;
sigfillset(&sigignore.sa_mask);
sigaction(SIGPIPE, &sigignore, NULL);
while ((ch = getopt(argc, argv, "bc:d:th?f:s:")) != -1) {
switch (ch) {
case 'c': /* configuration file */
- if (configfile != NULL) {
- free(configfile);
- }
- configfile = bstrdup(optarg);
- break;
+ if (configfile != NULL) {
+ free(configfile);
+ }
+ configfile = bstrdup(optarg);
+ break;
case 'd':
- debug_level = atoi(optarg);
- if (debug_level <= 0) {
- debug_level = 1;
- }
- break;
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
+ break;
case 't':
- test_config = true;
- break;
+ test_config = true;
+ break;
case 'h':
case '?':
default:
- usage();
- exit(1);
- }
+ usage();
+ exit(1);
+ }
}
argc -= optind;
//argv += optind;
}
parse_config(configfile);
-
+
LockRes();
nitems = 0;
foreach_res(monitor, R_MONITOR) {
}
if (nitems != 1) {
- Emsg2(M_ERROR_TERM, 0,
- _("Error: %d Monitor resource defined in %s. You must define one and only one Monitor resource.\n"), nitems, configfile);
+ Emsg2(M_ERROR_TERM, 0,
+ _("Error: %d Monitor resource defined in %s. You must define one and only one Monitor resource.\n"), nitems, configfile);
}
-
+
nitems = 0;
foreach_res(dird, R_DIRECTOR) {
items[nitems].type = R_DIRECTOR;
nitems++;
}
UnlockRes();
-
+
if (nitems == 0) {
- Emsg1(M_ERROR_TERM, 0, _("No Client, Storage nor Director resource defined in %s\n\
-Without that I don't how to get status from the File, Storage or Director Daemon :-(\n"), configfile);
+ Emsg1(M_ERROR_TERM, 0, _("No Client, Storage nor Director resource defined in %s\n"
+"Without that I don't how to get status from the File, Storage or Director Daemon :-(\n"), configfile);
}
if (test_config) {
exit(0);
}
-
+
//Copy the content of xpm_generic in xpm_generic_var to be able to modify it
g_assert((xpm_generic_var = (char**)g_malloc(sizeof(xpm_generic))));
for (i = 0; i < (int)(sizeof(xpm_generic)/sizeof(const char*)); i++) {
- g_assert((xpm_generic_var[i] = (char*)g_malloc(strlen(xpm_generic[i])*sizeof(char))));
+ g_assert((xpm_generic_var[i] = (char*)g_malloc((strlen(xpm_generic[i])+1)*sizeof(char))));
strcpy(xpm_generic_var[i], xpm_generic[i]);
}
-
+
(void)WSA_Init(); /* Initialize Windows sockets */
-
+
LockRes();
monitor = (MONITOR*)GetNextRes(R_MONITOR, (RES *)NULL);
UnlockRes();
-
+
if ((monitor->RefreshInterval < 1) || (monitor->RefreshInterval > 600)) {
- Emsg2(M_ERROR_TERM, 0, _("Invalid refresh interval defined in %s\n\
-This value must be greater or equal to 1 second and less or equal to 10 minutes (read value: %d).\n"), configfile, monitor->RefreshInterval);
+ Emsg2(M_ERROR_TERM, 0, _("Invalid refresh interval defined in %s\n"
+"This value must be greater or equal to 1 second and less or equal to 10 minutes (read value: %d).\n"), configfile, monitor->RefreshInterval);
}
-
+
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_xpm_data(generateXPM(warn, warn));
// This should be ideally replaced by a completely libpr0n-based icon rendering.
mTrayIcon = egg_status_icon_new_from_pixbuf(pixbuf);
g_object_unref(G_OBJECT(pixbuf));
mTrayMenu = gtk_menu_new();
-
+
GtkWidget *entry;
-
+
entry = gtk_menu_item_new_with_label("Open status window...");
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(TrayIconActivate), NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), entry);
-
+
gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), gtk_separator_menu_item_new());
-
+
entry = gtk_menu_item_new_with_label("Exit");
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(TrayIconExit), NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(mTrayMenu), entry);
-
+
gtk_widget_show_all(mTrayMenu);
-
+
timerTag = g_timeout_add( 1000*monitor->RefreshInterval/nitems, fd_read, NULL );
-
+
g_timeout_add( 1000, blink, NULL );
-
+
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-
+
gtk_window_set_title(GTK_WINDOW(window), "Bacula tray monitor");
-
+
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(delete_event), NULL);
//g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL);
-
+
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
-
+
GtkWidget* vbox = gtk_vbox_new(FALSE, 10);
-
+
GtkWidget* daemon_table = gtk_table_new((nitems*2)+2, 3, FALSE);
-
+
gtk_table_set_col_spacings(GTK_TABLE(daemon_table), 8);
-
+
GtkWidget* separator = gtk_hseparator_new();
gtk_table_attach_defaults(GTK_TABLE(daemon_table), separator, 0, 3, 0, 1);
-
+
GString *str;
GSList *group = NULL;
GtkWidget* radio;
GtkWidget* align;
-
+
for (int i = 0; i < nitems; i++) {
switch (items[i].type) {
case R_DIRECTOR:
- str = g_string_new(((DIRRES*)(items[i].resource))->hdr.name);
- g_string_append(str, _(" (DIR)"));
- break;
+ str = g_string_new(((DIRRES*)(items[i].resource))->hdr.name);
+ g_string_append(str, _(" (DIR)"));
+ break;
case R_CLIENT:
- str = g_string_new(((CLIENT*)(items[i].resource))->hdr.name);
- g_string_append(str, _(" (FD)"));
- break;
+ str = g_string_new(((CLIENT*)(items[i].resource))->hdr.name);
+ g_string_append(str, _(" (FD)"));
+ break;
case R_STORAGE:
- str = g_string_new(((STORE*)(items[i].resource))->hdr.name);
- g_string_append(str, _(" (SD)"));
- break;
+ str = g_string_new(((STORE*)(items[i].resource))->hdr.name);
+ g_string_append(str, _(" (SD)"));
+ break;
default:
- continue;
+ continue;
}
-
+
radio = gtk_radio_button_new_with_label(group, str->str);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), i == 0);
g_signal_connect(G_OBJECT(radio), "toggled", G_CALLBACK(DaemonChanged), &(items[i]));
-
+
pixbuf = gdk_pixbuf_new_from_xpm_data(generateXPM(warn, warn));
items[i].image = gtk_image_new_from_pixbuf(pixbuf);
-
+
items[i].label = gtk_label_new(_("Unknown status."));
align = gtk_alignment_new(0.0, 0.5, 0.0, 1.0);
gtk_container_add(GTK_CONTAINER(align), items[i].label);
-
- gtk_table_attach(GTK_TABLE(daemon_table), radio, 0, 1, (i*2)+1, (i*2)+2,
- GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
- gtk_table_attach(GTK_TABLE(daemon_table), items[i].image, 1, 2, (i*2)+1, (i*2)+2,
- GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
- gtk_table_attach(GTK_TABLE(daemon_table), align, 2, 3, (i*2)+1, (i*2)+2,
- (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-
+
+ gtk_table_attach(GTK_TABLE(daemon_table), radio, 0, 1, (i*2)+1, (i*2)+2,
+ GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach(GTK_TABLE(daemon_table), items[i].image, 1, 2, (i*2)+1, (i*2)+2,
+ GTK_FILL, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach(GTK_TABLE(daemon_table), align, 2, 3, (i*2)+1, (i*2)+2,
+ (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
+
separator = gtk_hseparator_new();
gtk_table_attach_defaults(GTK_TABLE(daemon_table), separator, 0, 3, (i*2)+2, (i*2)+3);
-
+
group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio));
}
-
+
gtk_box_pack_start(GTK_BOX(vbox), daemon_table, FALSE, FALSE, 0);
-
+
textview = gtk_text_view_new();
buffer = gtk_text_buffer_new(NULL);
PangoFontDescription *font_desc = pango_font_description_from_string ("Fixed 10");
gtk_widget_modify_font(textview, font_desc);
pango_font_description_free(font_desc);
-
+
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(textview), 20);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(textview), 20);
-
+
gtk_text_view_set_editable(GTK_TEXT_VIEW(textview), FALSE);
-
+
gtk_text_view_set_buffer(GTK_TEXT_VIEW(textview), buffer);
-
+
gtk_box_pack_start(GTK_BOX(vbox), textview, TRUE, TRUE, 0);
-
+
GtkWidget* hbox = gtk_hbox_new(FALSE, 10);
GtkWidget* hbox2 = gtk_hbox_new(FALSE, 0);
g_signal_connect(G_OBJECT(timeoutspinner), "value-changed", G_CALLBACK(IntervalChanged), NULL);
gtk_box_pack_start(GTK_BOX(hbox2), timeoutspinner, TRUE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), hbox2, TRUE, FALSE, 0);
-
+
GtkWidget* button = new_image_button("gtk-refresh", _("Refresh now"));
g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(MonitorRefresh), NULL);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-
+
button = new_image_button("gtk-help", _("About"));
g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(MonitorAbout), NULL);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-
+
button = new_image_button("gtk-close", _("Close"));
- g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window));
+ g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_hide), G_OBJECT(window));
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, FALSE, 0);
-
+
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
+
gtk_container_add(GTK_CONTAINER (window), vbox);
-
+
gtk_widget_show_all(vbox);
-
+
gtk_main();
-
+
+ g_source_remove(timerTag);
+
+ sm_line = 0;
+
for (i = 0; i < nitems; i++) {
if (items[i].D_sock) {
- writecmd(&items[i], "quit");
- bnet_sig(items[i].D_sock, BNET_TERMINATE); /* send EOF */
- bnet_close(items[i].D_sock);
+ writecmd(&items[i], "quit");
+ bnet_sig(items[i].D_sock, BNET_TERMINATE); /* send EOF */
+ bnet_close(items[i].D_sock);
}
}
- free_pool_memory(args);
(void)WSACleanup(); /* Cleanup Windows sockets */
-
+
//Free xpm_generic_var
for (i = 0; i < (int)(sizeof(xpm_generic)/sizeof(const char*)); i++) {
g_free(xpm_generic_var[i]);
}
g_free(xpm_generic_var);
+ gtk_object_destroy(GTK_OBJECT(window));
+ gtk_object_destroy(GTK_OBJECT(mTrayMenu));
+ term_msg();
+
+#if TRAY_DEBUG_MEMORY
+ sm_dump(false);
+#endif
+
return 0;
}
"Copyright (C) 2004 Kern Sibbald and John Walker\n"
"Written by Nicolas Boichat\n"
"\nVersion: " VERSION " (" BDATE ") %s %s %s"
- ), HOST_OS, DISTNAME, DISTVER);
+ ), HOST_OS, DISTNAME, DISTVER);
#endif
gtk_dialog_run(GTK_DIALOG(about));
gtk_widget_destroy(about);
}
static gboolean delete_event( GtkWidget *widget,
- GdkEvent *event,
- gpointer data ) {
+ GdkEvent *event,
+ gpointer data ) {
gtk_widget_hide(window);
return TRUE; /* do not destroy the window */
}
g_source_remove(timerTag);
timerTag = g_timeout_add(
(guint)(
- gtk_spin_button_get_value(GTK_SPIN_BUTTON(timeoutspinner))*1000/nitems
+ gtk_spin_button_get_value(GTK_SPIN_BUTTON(timeoutspinner))*1000/nitems
), fd_read, NULL );
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
fullitem = -1;
for (int i = 0; i < nitems; i++) {
- if (data == &(items[i])) {
- fullitem = i;
- break;
- }
+ if (data == &(items[i])) {
+ fullitem = i;
+ break;
+ }
}
g_return_if_fail(fullitem != -1);
switch (item->type) {
case R_DIRECTOR:
return authenticate_director(jcr, monitor, (DIRRES*)item->resource);
- break;
+ break;
case R_CLIENT:
return authenticate_file_daemon(jcr, monitor, (CLIENT*)item->resource);
break;
}
static gboolean fd_read(gpointer data) {
- GtkTextBuffer *newbuffer = gtk_text_buffer_new(NULL);
+ sm_line++;
+#if TRAY_DEBUG_MEMORY
+ printf("sm_line=%d\n", sm_line);
+#endif
+ GtkTextBuffer *newbuffer;
GtkTextIter start, stop, nstart, nstop;
GSList *list, *it;
-
+
GString *strlast, *strcurrent;
-
+
lastupdated++;
if (lastupdated == nitems) {
lastupdated = 0;
}
-
+
if (lastupdated == fullitem) {
+ newbuffer = gtk_text_buffer_new(NULL);
+
if (items[lastupdated].type == R_DIRECTOR)
- docmd(&items[lastupdated], "status Director\n", &list);
+ docmd(&items[lastupdated], "status Director\n", &list);
else
- docmd(&items[lastupdated], "status\n", &list);
-
+ docmd(&items[lastupdated], "status\n", &list);
+
it = list->next;
do {
- gtk_text_buffer_get_end_iter(newbuffer, &stop);
- gtk_text_buffer_insert (newbuffer, &stop, ((GString*)it->data)->str, -1);
- if (it->data) g_string_free((GString*)it->data, TRUE);
+ gtk_text_buffer_get_end_iter(newbuffer, &stop);
+ gtk_text_buffer_insert (newbuffer, &stop, ((GString*)it->data)->str, -1);
+ if (it->data) g_string_free((GString*)it->data, TRUE);
} while ((it = it->next) != NULL);
-
+
+ g_slist_free(list);
+
/* Keep the selection if necessary */
if (gtk_text_buffer_get_selection_bounds(buffer, &start, &stop)) {
- gtk_text_buffer_get_iter_at_offset(newbuffer, &nstart, gtk_text_iter_get_offset(&start));
- gtk_text_buffer_get_iter_at_offset(newbuffer, &nstop, gtk_text_iter_get_offset(&stop ));
-
+ gtk_text_buffer_get_iter_at_offset(newbuffer, &nstart, gtk_text_iter_get_offset(&start));
+ gtk_text_buffer_get_iter_at_offset(newbuffer, &nstop, gtk_text_iter_get_offset(&stop ));
+
#if HAVE_GTK_2_4
- gtk_text_buffer_select_range(newbuffer, &nstart, &nstop);
+ gtk_text_buffer_select_range(newbuffer, &nstart, &nstop);
#else
- gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "insert"), &nstart);
- gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "selection_bound"), &nstop);
+ gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "insert"), &nstart);
+ gtk_text_buffer_move_mark(newbuffer, gtk_text_buffer_get_mark(newbuffer, "selection_bound"), &nstop);
#endif
}
-
+
g_object_unref(buffer);
-
+
buffer = newbuffer;
gtk_text_view_set_buffer(GTK_TEXT_VIEW(textview), buffer);
}
-
+
getstatus(&items[lastupdated], 1, &strcurrent);
getstatus(&items[lastupdated], 0, &strlast);
updateStatusIcon(&items[lastupdated]);
-
+
changeStatusMessage(&items[lastupdated], "Current job: %s\nLast job: %s", strcurrent->str, strlast->str);
-
+
updateStatusIcon(NULL);
-
+
g_string_free(strcurrent, TRUE);
g_string_free(strlast, TRUE);
-
+
return 1;
}
char jobstatus = JS_ErrorTerminated;
char num;
int k;
-
+
*str = g_string_sized_new(128);
-
+
if (current) {
if (item->type == R_DIRECTOR)
- docmd(&items[lastupdated], ".status dir current\n", &list);
+ docmd(&items[lastupdated], ".status dir current\n", &list);
else
- docmd(&items[lastupdated], ".status current\n", &list);
+ docmd(&items[lastupdated], ".status current\n", &list);
}
else {
if (item->type == R_DIRECTOR)
- docmd(&items[lastupdated], ".status dir last\n", &list);
+ docmd(&items[lastupdated], ".status dir last\n", &list);
else
- docmd(&items[lastupdated], ".status last\n", &list);
+ docmd(&items[lastupdated], ".status last\n", &list);
}
it = list->next;
if ((it == NULL) || (sscanf(((GString*)it->data)->str, OKqstatus, &num) != 1)) {
g_string_append_printf(*str, ".status error : %s", (it == NULL) ? "" : ((GString*)it->data)->str);
while (((*str)->str[(*str)->len-1] == '\n') || ((*str)->str[(*str)->len-1] == '\r')) {
- g_string_set_size(*str, (*str)->len-1);
+ g_string_set_size(*str, (*str)->len-1);
}
ret = error;
}
else if ((it = it->next) == NULL) {
if (current) {
- g_string_append(*str, _("No current job."));
+ g_string_append(*str, _("No current job."));
}
else {
- g_string_append(*str, _("No last job."));
+ g_string_append(*str, _("No last job."));
}
ret = idle;
}
else if ((k = sscanf(((GString*)it->data)->str, DotStatusJob, &jobid, &jobstatus, &joberrors)) == 3) {
switch (jobstatus) {
case JS_Created:
- ret = (joberrors > 0) ? warn : running;
- g_string_append_printf(*str, _("Job status: Created (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- break;
+ ret = (joberrors > 0) ? warn : running;
+ g_string_append_printf(*str, _("Job status: Created (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ break;
case JS_Running:
- ret = (joberrors > 0) ? warn : running;
- g_string_append_printf(*str, _("Job status: Running (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- break;
+ ret = (joberrors > 0) ? warn : running;
+ g_string_append_printf(*str, _("Job status: Running (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ break;
case JS_Blocked:
- g_string_append_printf(*str, _("Job status: Blocked (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Blocked (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_Terminated:
- g_string_append_printf(*str, _("Job status: Terminated (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = (joberrors > 0) ? warn : idle;
- break;
+ g_string_append_printf(*str, _("Job status: Terminated (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = (joberrors > 0) ? warn : idle;
+ break;
case JS_ErrorTerminated:
- g_string_append_printf(*str, _("Job status: Terminated in error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = error;
- break;
+ g_string_append_printf(*str, _("Job status: Terminated in error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = error;
+ break;
case JS_Error:
- ret = (joberrors > 0) ? warn : running;
- g_string_append_printf(*str, _("Job status: Error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- break;
+ ret = (joberrors > 0) ? warn : running;
+ g_string_append_printf(*str, _("Job status: Error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ break;
case JS_FatalError:
- g_string_append_printf(*str, _("Job status: Fatal error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = error;
- break;
+ g_string_append_printf(*str, _("Job status: Fatal error (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = error;
+ break;
case JS_Differences:
- g_string_append_printf(*str, _("Job status: Verify differences (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Verify differences (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_Canceled:
- g_string_append_printf(*str, _("Job status: Canceled (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Canceled (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitFD:
- g_string_append_printf(*str, _("Job status: Waiting on File daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting on File daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitSD:
- g_string_append_printf(*str, _("Job status: Waiting on the Storage daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting on the Storage daemon (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitMedia:
- g_string_append_printf(*str, _("Job status: Waiting for new media (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for new media (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitMount:
- g_string_append_printf(*str, _("Job status: Waiting for Mount (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for Mount (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitStoreRes:
- g_string_append_printf(*str, _("Job status: Waiting for storage resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for storage resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitJobRes:
- g_string_append_printf(*str, _("Job status: Waiting for job resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for job resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitClientRes:
- g_string_append_printf(*str, _("Job status: Waiting for Client resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for Client resource (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitMaxJobs:
- g_string_append_printf(*str, _("Job status: Waiting for maximum jobs (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for maximum jobs (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitStartTime:
- g_string_append_printf(*str, _("Job status: Waiting for start time (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for start time (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
case JS_WaitPriority:
- g_string_append_printf(*str, _("Job status: Waiting for higher priority jobs to finish (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_string_append_printf(*str, _("Job status: Waiting for higher priority jobs to finish (%d error%s)"), joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
default:
- g_warning("Unknown job status %c.", jobstatus);
- g_string_append_printf(*str, _("Job status: Unknown(%c) (%d error%s)"), jobstatus, joberrors, (joberrors > 1) ? "s" : "");
- ret = warn;
- break;
+ g_warning("Unknown job status %c.", jobstatus);
+ g_string_append_printf(*str, _("Job status: Unknown(%c) (%d error%s)"), jobstatus, joberrors, (joberrors > 1) ? "s" : "");
+ ret = warn;
+ break;
}
}
else {
fprintf(stderr, "Bad scan : '%s' %d\n", (it == NULL) ? "" : ((GString*)it->data)->str, k);
ret = error;
}
-
+
it = list;
do {
if (it->data) g_string_free((GString*)it->data, TRUE);
} while ((it = it->next) != NULL);
-
+
g_slist_free(list);
-
+
if (current) {
item->state = ret;
}
int docmd(monitoritem* item, const char* command, GSList** list) {
int stat;
GString* str = NULL;
-
+
*list = g_slist_alloc();
//str = g_string_sized_new(64);
-
+
if (!item->D_sock) {
memset(&jcr, 0, sizeof(jcr));
-
+
DIRRES* dird;
CLIENT* filed;
STORE* stored;
-
+
switch (item->type) {
case R_DIRECTOR:
- dird = (DIRRES*)item->resource;
- trayMessage("Connecting to Director %s:%d\n", dird->address, dird->DIRport);
- changeStatusMessage(item, "Connecting to Director %s:%d", dird->address, dird->DIRport);
- item->D_sock = bnet_connect(NULL, 0, 0, "Director daemon", dird->address, NULL, dird->DIRport, 0);
- jcr.dir_bsock = item->D_sock;
- break;
+ dird = (DIRRES*)item->resource;
+ trayMessage("Connecting to Director %s:%d\n", dird->address, dird->DIRport);
+ changeStatusMessage(item, "Connecting to Director %s:%d", dird->address, dird->DIRport);
+ item->D_sock = bnet_connect(NULL, 0, 0, "Director daemon", dird->address, NULL, dird->DIRport, 0);
+ jcr.dir_bsock = item->D_sock;
+ break;
case R_CLIENT:
- filed = (CLIENT*)item->resource;
- trayMessage("Connecting to Client %s:%d\n", filed->address, filed->FDport);
- changeStatusMessage(item, "Connecting to Client %s:%d", filed->address, filed->FDport);
- item->D_sock = bnet_connect(NULL, 0, 0, "File daemon", filed->address, NULL, filed->FDport, 0);
- jcr.file_bsock = item->D_sock;
- break;
+ filed = (CLIENT*)item->resource;
+ trayMessage("Connecting to Client %s:%d\n", filed->address, filed->FDport);
+ changeStatusMessage(item, "Connecting to Client %s:%d", filed->address, filed->FDport);
+ item->D_sock = bnet_connect(NULL, 0, 0, "File daemon", filed->address, NULL, filed->FDport, 0);
+ jcr.file_bsock = item->D_sock;
+ break;
case R_STORAGE:
- stored = (STORE*)item->resource;
- trayMessage("Connecting to Storage %s:%d\n", stored->address, stored->SDport);
- changeStatusMessage(item, "Connecting to Storage %s:%d", stored->address, stored->SDport);
- item->D_sock = bnet_connect(NULL, 0, 0, "Storage daemon", stored->address, NULL, stored->SDport, 0);
- jcr.store_bsock = item->D_sock;
- break;
+ stored = (STORE*)item->resource;
+ trayMessage("Connecting to Storage %s:%d\n", stored->address, stored->SDport);
+ changeStatusMessage(item, "Connecting to Storage %s:%d", stored->address, stored->SDport);
+ item->D_sock = bnet_connect(NULL, 0, 0, "Storage daemon", stored->address, NULL, stored->SDport, 0);
+ jcr.store_bsock = item->D_sock;
+ break;
default:
- printf("Error, currentitem is not a Client, a Storage or a Director..\n");
- gtk_main_quit();
- return 0;
+ printf("Error, currentitem is not a Client, a Storage or a Director..\n");
+ gtk_main_quit();
+ return 0;
}
-
+
if (item->D_sock == NULL) {
- g_slist_append(*list, g_string_new("Cannot connect to daemon.\n"));
- changeStatusMessage(item, "Cannot connect to daemon.");
- item->state = error;
- item->oldstate = error;
- return 0;
+ g_slist_append(*list, g_string_new("Cannot connect to daemon.\n"));
+ changeStatusMessage(item, "Cannot connect to daemon.");
+ item->state = error;
+ item->oldstate = error;
+ return 0;
}
-
+
if (!authenticate_daemon(item, &jcr)) {
- str = g_string_sized_new(64);
- g_string_printf(str, "ERR=%s\n", item->D_sock->msg);
- g_slist_append(*list, str);
- item->state = error;
- item->oldstate = error;
- changeStatusMessage(item, "Authentication error : %s", item->D_sock->msg);
- item->D_sock = NULL;
- return 0;
+ str = g_string_sized_new(64);
+ g_string_printf(str, "ERR=%s\n", item->D_sock->msg);
+ g_slist_append(*list, str);
+ item->state = error;
+ item->oldstate = error;
+ changeStatusMessage(item, "Authentication error : %s", item->D_sock->msg);
+ item->D_sock = NULL;
+ return 0;
}
-
+
switch (item->type) {
case R_DIRECTOR:
- trayMessage("Opened connection with Director daemon.\n");
- changeStatusMessage(item, "Opened connection with Director daemon.");
- break;
+ trayMessage("Opened connection with Director daemon.\n");
+ changeStatusMessage(item, "Opened connection with Director daemon.");
+ break;
case R_CLIENT:
- trayMessage("Opened connection with File daemon.\n");
- changeStatusMessage(item, "Opened connection with File daemon.");
- break;
+ trayMessage("Opened connection with File daemon.\n");
+ changeStatusMessage(item, "Opened connection with File daemon.");
+ break;
case R_STORAGE:
- trayMessage("Opened connection with Storage daemon.\n");
- changeStatusMessage(item, "Opened connection with Storage daemon.");
- break;
+ trayMessage("Opened connection with Storage daemon.\n");
+ changeStatusMessage(item, "Opened connection with Storage daemon.");
+ break;
default:
- printf("Error, currentitem is not a Client, a Storage or a Director..\n");
- gtk_main_quit();
- return 0;
- break;
+ printf("Error, currentitem is not a Client, a Storage or a Director..\n");
+ gtk_main_quit();
+ return 0;
+ break;
}
-
+
if (item->type == R_DIRECTOR) { /* Read connection messages... */
- GSList *list, *it;
- docmd(item, "", &list); /* Usually invalid, but no matter */
- it = list;
- do {
- if (it->data) g_string_free((GString*)it->data, TRUE);
- } while ((it = it->next) != NULL);
-
- g_slist_free(list);
+ GSList *list, *it;
+ docmd(item, "", &list); /* Usually invalid, but no matter */
+ it = list;
+ do {
+ if (it->data) g_string_free((GString*)it->data, TRUE);
+ } while ((it = it->next) != NULL);
+
+ g_slist_free(list);
}
}
-
+
if (command[0] != 0)
writecmd(item, command);
-
+
while(1) {
if ((stat = bnet_recv(item->D_sock)) >= 0) {
- g_slist_append(*list, g_string_new(item->D_sock->msg));
+ g_slist_append(*list, g_string_new(item->D_sock->msg));
}
else if (stat == BNET_SIGNAL) {
- if (item->D_sock->msglen == BNET_EOD) {
- //fprintf(stderr, "<< EOD >>\n");
- return 1;
- }
- else if (item->D_sock->msglen == BNET_PROMPT) {
- //fprintf(stderr, "<< PROMPT >>\n");
- g_slist_append(*list, g_string_new("<< Error: BNET_PROMPT signal received. >>\n"));
- return 0;
- }
- else if (item->D_sock->msglen == BNET_HEARTBEAT) {
- bnet_sig(item->D_sock, BNET_HB_RESPONSE);
- g_slist_append(*list, g_string_new("<< Heartbeat signal received, answered. >>\n"));
- }
- else {
- str = g_string_sized_new(64);
- g_string_printf(str, "<< Unexpected signal received : %s >>\n", bnet_sig_to_ascii(item->D_sock));
- g_slist_append(*list, str);
- }
+ if (item->D_sock->msglen == BNET_EOD) {
+ //fprintf(stderr, "<< EOD >>\n");
+ return 1;
+ }
+ else if (item->D_sock->msglen == BNET_PROMPT) {
+ //fprintf(stderr, "<< PROMPT >>\n");
+ g_slist_append(*list, g_string_new("<< Error: BNET_PROMPT signal received. >>\n"));
+ return 0;
+ }
+ else if (item->D_sock->msglen == BNET_HEARTBEAT) {
+ bnet_sig(item->D_sock, BNET_HB_RESPONSE);
+ g_slist_append(*list, g_string_new("<< Heartbeat signal received, answered. >>\n"));
+ }
+ else {
+ str = g_string_sized_new(64);
+ g_string_printf(str, "<< Unexpected signal received : %s >>\n", bnet_sig_to_ascii(item->D_sock));
+ g_slist_append(*list, str);
+ }
}
else { /* BNET_HARDEOF || BNET_ERROR */
- g_slist_append(*list, g_string_new("<ERROR>\n"));
- item->D_sock = NULL;
- item->state = error;
- item->oldstate = error;
- changeStatusMessage(item, "Error : BNET_HARDEOF or BNET_ERROR");
- //fprintf(stderr, "<< ERROR >>\n");
- return 0;
+ g_slist_append(*list, g_string_new("<ERROR>\n"));
+ item->D_sock = NULL;
+ item->state = error;
+ item->oldstate = error;
+ changeStatusMessage(item, "Error : BNET_HARDEOF or BNET_ERROR");
+ //fprintf(stderr, "<< ERROR >>\n");
+ return 0;
}
-
+
if (is_bnet_stop(item->D_sock)) {
- g_string_append_printf(str, "<STOP>\n");
- item->D_sock = NULL;
- item->state = error;
- item->oldstate = error;
- changeStatusMessage(item, "Error : Connection closed.");
- //fprintf(stderr, "<< STOP >>\n");
- return 0; /* error or term */
+ g_string_append_printf(str, "<STOP>\n");
+ item->D_sock = NULL;
+ item->state = error;
+ item->oldstate = error;
+ changeStatusMessage(item, "Error : Connection closed.");
+ //fprintf(stderr, "<< STOP >>\n");
+ return 0; /* error or term */
}
}
}
void trayMessage(const char *fmt,...) {
char buf[512];
va_list arg_ptr;
-
+
va_start(arg_ptr, fmt);
bvsnprintf(buf, sizeof(buf), (char *)fmt, arg_ptr);
va_end(arg_ptr);
-
+
fprintf(stderr, buf);
-
+
egg_tray_icon_send_message(egg_status_icon_get_tray_icon(mTrayIcon), 5000, (const char*)&buf, -1);
}
void changeStatusMessage(monitoritem* item, const char *fmt,...) {
char buf[512];
va_list arg_ptr;
-
+
va_start(arg_ptr, fmt);
bvsnprintf(buf, sizeof(buf), (char *)fmt, arg_ptr);
va_end(arg_ptr);
void updateStatusIcon(monitoritem* item) {
const char** xpm;
-
+
if (item == NULL) {
/* For the current status, select the two worse for blinking,
- but never blink a D_Sock == NULL error with idle. */
+ but never blink a D_Sock == NULL error with idle. */
stateenum state1, state2, oldstate;
gboolean onenull = FALSE;
state1 = idle;
state2 = idle;
oldstate = idle;
for (int i = 0; i < nitems; i++) {
- if (items[i].D_sock == NULL) onenull = TRUE;
- if (items[i].state >= state1) {
- state2 = state1;
- state1 = items[i].state;
- }
- else if (items[i].state > state2) {
- state2 = items[i].state;
- }
- if (items[i].oldstate > oldstate) oldstate = items[i].oldstate;
+ if (items[i].D_sock == NULL) onenull = TRUE;
+ if (items[i].state >= state1) {
+ state2 = state1;
+ state1 = items[i].state;
+ }
+ else if (items[i].state > state2) {
+ state2 = items[i].state;
+ }
+ if (items[i].oldstate > oldstate) oldstate = items[i].oldstate;
}
-
+
if ((onenull == TRUE) && (state2 == idle)) {
- state2 = error;
+ state2 = error;
}
-
+
xpm = generateXPM(blinkstate ? state1 : state2, oldstate);
}
else {
if ((blinkstate) && (item->D_sock != NULL)) {
- if (item->state > 1) { //Warning or error while running
- xpm = generateXPM(running, item->oldstate);
- }
- else {
- xpm = generateXPM(idle, item->oldstate);
- }
+ if (item->state > 1) { //Warning or error while running
+ xpm = generateXPM(running, item->oldstate);
+ }
+ else {
+ xpm = generateXPM(idle, item->oldstate);
+ }
}
else {
- xpm = generateXPM(item->state, item->oldstate);
+ xpm = generateXPM(item->state, item->oldstate);
}
}
-
+
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_xpm_data(xpm);
if (item == NULL) {
egg_status_icon_set_from_pixbuf(mTrayIcon, pixbuf);
else {
gtk_image_set_from_pixbuf(GTK_IMAGE(item->image), pixbuf);
}
+ g_object_unref(G_OBJECT(pixbuf));
}
/* Note: result should not be stored, as it is a reference to xpm_generic_var */
strcpy(address, "ffff00");
break;
}
-
+
address = &xpm_generic_var[xpm_generic_second_color][xpm_generic_column];
switch (oldstate) {
case error:
strcpy(address, "ffff00");
break;
}
-
+
return (const char**)xpm_generic_var;
}
*/
#include <gtk/gtk.h>
-
+
#include "tray_conf.h"
#include "jcr.h"
*
* 1. The generic lexical scanner in lib/lex.c and lib/lex.h
*
-* 2. The generic config scanner in lib/parse_config.c and
+* 2. The generic config scanner in lib/parse_config.c and
* lib/parse_config.h.
* These files contain the parser code, some utility
* routines, and the common store routines (name, int,
/* Definition of records permitted within each
-* resource with the routine to process the record
+* resource with the routine to process the record
* information. NOTE! quoted names must be in lower case.
-*/
-/*
+*/
+/*
* Monitor Resource
*
* name handler value code flags default_value
{"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(res_dir.address), 0, 0, 0},
{"enablessl", store_yesno, ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, NULL, 0, 0, 0}
};
-/*
+/*
* Client or File daemon resource
*
* name handler value code flags default_value
{"fdport", store_pint, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102},
{"password", store_password, ITEM(res_client.password), 0, ITEM_REQUIRED, 0},
{"enablessl", store_yesno, ITEM(res_client.enable_ssl), 1, ITEM_DEFAULT, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, NULL, 0, 0, 0}
};
/* Storage daemon resource
{"password", store_password, ITEM(res_store.password), 0, ITEM_REQUIRED, 0},
{"sdpassword", store_password, ITEM(res_store.password), 0, 0, 0},
{"enablessl", store_yesno, ITEM(res_store.enable_ssl), 1, ITEM_DEFAULT, 0},
- {NULL, NULL, NULL, 0, 0, 0}
+ {NULL, NULL, NULL, 0, 0, 0}
};
-/*
-* This is the master resource definition.
+/*
+* This is the master resource definition.
* It must have one item for each of the resources.
*
* NOTE!!! keep it in the same order as the R_codes
}
switch (type) {
case R_MONITOR:
- sendit(sock, "Monitor: name=%s FDtimeout=%s SDtimeout=%s\n",
- reshdr->name,
+ sendit(sock, "Monitor: name=%s FDtimeout=%s SDtimeout=%s\n",
+ reshdr->name,
edit_uint64(res->res_monitor.FDConnectTimeout, ed1),
edit_uint64(res->res_monitor.SDConnectTimeout, ed2));
break;
}
-/*
+/*
* Free memory of resource -- called when daemon terminates.
* NB, we don't need to worry about freeing any references
-* to other resources as they will be freed when that
+* to other resources as they will be freed when that
* resource chain is traversed. Mainly we worry about freeing
* allocated strings (names).
*/
/*
* Save the new resource by chaining it into the head list for
* the resource. If this is pass 2, we update any resource
-* pointers because they may not have been defined until
+* pointers because they may not have been defined until
* later in pass 1.
*/
void save_resource(int type, RES_ITEM *items, int pass)
int rindex = type - r_first;
int i, size;
int error = 0;
-
- /*
+
+ /*
* Ensure that all required items are present
*/
for (i=0; items[i].name; i++) {
if (items[i].flags & ITEM_REQUIRED) {
- if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) {
- Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
- items[i].name, resources[rindex]);
- }
+ if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) {
+ Emsg2(M_ERROR_TERM, 0, "%s item is required in %s resource, but not found.\n",
+ items[i].name, resources[rindex]);
+ }
}
/* If this triggers, take a look at lib/parse_conf.h */
if (i >= MAX_RES_ITEMS) {
- Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
+ Emsg1(M_ERROR_TERM, 0, "Too many items in %s resource\n", resources[rindex]);
}
}
/*
- * During pass 2 in each "store" routine, we looked up pointers
+ * During pass 2 in each "store" routine, we looked up pointers
* to all the resources referrenced in the current resource, now we
* must copy their addresses from the static record to the allocated
* record.
case R_CLIENT:
case R_STORAGE:
case R_DIRECTOR:
- break;
+ break;
default:
- Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
- error = 1;
- break;
+ Emsg1(M_ERROR, 0, "Unknown resource type %d in save_resource.\n", type);
+ error = 1;
+ break;
}
/* Note, the resource name was already saved during pass 1,
* so here, we can just release it.
*/
if (res_all.res_monitor.hdr.name) {
- free(res_all.res_monitor.hdr.name);
- res_all.res_monitor.hdr.name = NULL;
+ free(res_all.res_monitor.hdr.name);
+ res_all.res_monitor.hdr.name = NULL;
}
if (res_all.res_monitor.hdr.desc) {
- free(res_all.res_monitor.hdr.desc);
- res_all.res_monitor.hdr.desc = NULL;
+ free(res_all.res_monitor.hdr.desc);
+ res_all.res_monitor.hdr.desc = NULL;
}
return;
}
/*
- * The following code is only executed during pass 1
+ * The following code is only executed during pass 1
*/
switch (type) {
case R_MONITOR:
size = sizeof(CLIENT);
break;
case R_STORAGE:
- size = sizeof(STORE);
+ size = sizeof(STORE);
break;
default:
printf("Unknown resource type %d in save_resrouce.\n", type);
memcpy(res, &res_all, size);
if (!res_head[rindex]) {
res_head[rindex] = (RES *)res; /* store first entry */
- Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
- res->res_monitor.hdr.name, rindex);
+ Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
+ res->res_monitor.hdr.name, rindex);
} else {
RES *next;
/* Add new res to end of chain */
for (next=res_head[rindex]; next->next; next=next->next) {
if (strcmp(next->name, res->res_monitor.hdr.name) == 0) {
- Emsg2(M_ERROR_TERM, 0,
- _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
- resources[rindex].name, res->res_monitor.hdr.name);
+ Emsg2(M_ERROR_TERM, 0,
+ _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
+ resources[rindex].name, res->res_monitor.hdr.name);
}
}
next->next = (RES *)res;
- Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
- res->res_monitor.hdr.name, rindex, pass);
+ Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type),
+ res->res_monitor.hdr.name, rindex, pass);
}
}
}
/* NOTE: #includes at the end of this file */
/*
- * Resource codes -- they must be sequential for indexing
+ * Resource codes -- they must be sequential for indexing
*/
enum rescode {
R_MONITOR = 1001,
int enable_ssl; /* Use SSL */
};
-/*
- * Tray Monitor Resource
+/*
+ * Tray Monitor Resource
*
*/
struct MONITOR {
/*
* Store Resource
- *
+ *
*/
struct STORE {
RES hdr;
/* */
#undef VERSION
-#define VERSION "1.36.1"
-#define BDATE "24 November 2004"
-#define LSMDATE "24Nov04"
+#define VERSION "1.36.3"
+#define BDATE "22 April 2005"
+#define LSMDATE "22Apr05"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
-#define SMCHECK
-#define TRACE_FILE 1
+#define SMCHECK
+#define TRACE_FILE 1
/* If this is set stdout will not be closed on startup */
-#define DEVELOPER 1
+/* #define DEVELOPER 1 */
/* #define TRACE_JCR_CHAIN 1 */
/* #define TRACE_RES 1 */
/* #define DEBUG_MEMSET 1 */
+/* #define DEBUG_MUTEX 1 */
/* Check if header of tape block is zero before writing */
#define DEBUG_BLOCK_ZEROING 1
/* #define SEND_DMSG_TO_FILE 1 */
+/* The following are turned on for performance testing */
/* #define NO_ATTRIBUTES_TEST 1 */
/* #define NO_TAPE_WRITE_TEST 1 */
/* #define FD_NO_SEND TEST 1 */
-/* #define DEBUG_MUTEX 1 */
}
}
-int
-umask(int)
+int umask(int)
{
- return 0;
+ return 0;
}
-int
-chmod(const char *, mode_t)
+int chmod(const char *, mode_t)
{
- return 0;
+ return 0;
}
-int
-chown(const char *k, uid_t, gid_t)
+int chown(const char *k, uid_t, gid_t)
{
- return 0;
+ return 0;
}
-int
-lchown(const char *k, uid_t, gid_t)
+int lchown(const char *k, uid_t, gid_t)
{
- return 0;
+ return 0;
}
-
+bool fstype(const char *fname, char *fs, int fslen)
+{
+ return true;
+}
long int
random(void)
void
srandom(unsigned int seed)
{
- srand(seed);
+ srand(seed);
}
// /////////////////////////////////////////////////////////////////
// convert from Windows concept of time to Unix concept of time
int
kill(int pid, int signal)
{
- int rval = 0;
- if (!TerminateProcess((HANDLE)pid, (UINT) signal)) {
- rval = -1;
- errno = b_errno_win32;
- }
- CloseHandle((HANDLE)pid);
- return rval;
+ int rval = 0;
+ if (!TerminateProcess((HANDLE)pid, (UINT) signal)) {
+ rval = -1;
+ errno = b_errno_win32;
+ }
+ CloseHandle((HANDLE)pid);
+ return rval;
}
#ifndef HAVE_MINGW
int
close_bpipe(BPIPE *bpipe)
{
- int rval = 0;
- if (bpipe->rfd) fclose(bpipe->rfd);
- if (bpipe->wfd) fclose(bpipe->wfd);
-
- if (bpipe->wait) {
- int remaining_wait = bpipe->wait;
- do {
- DWORD exitCode;
- if (!GetExitCodeProcess((HANDLE)bpipe->worker_pid, &exitCode)) {
- const char *err = errorString();
- rval = b_errno_win32;
- d_msg(__FILE__, __LINE__, 0,
- "GetExitCode error %s\n", err);
- LocalFree((void *)err);
- break;
- }
-
- if (exitCode == STILL_ACTIVE) {
- bmicrosleep(1, 0); /* wait one second */
- remaining_wait--;
- }
- else break;
- } while(remaining_wait);
- rval = ETIME; /* timed out */
- }
+ int rval = 0;
+ int32_t remaining_wait = bpipe->wait;
- if (bpipe->timer_id) {
- stop_child_timer(bpipe->timer_id);
- }
- free((void *)bpipe);
- return rval;
+ if (remaining_wait == 0) { /* wait indefinitely */
+ remaining_wait = INT32_MAX;
+ }
+ for ( ;; ) {
+ DWORD exitCode;
+ if (!GetExitCodeProcess((HANDLE)bpipe->worker_pid, &exitCode)) {
+ const char *err = errorString();
+ rval = b_errno_win32;
+ d_msg(__FILE__, __LINE__, 0,
+ "GetExitCode error %s\n", err);
+ LocalFree((void *)err);
+ break;
+ }
+ if (exitCode == STILL_ACTIVE) {
+ if (remaining_wait <= 0) {
+ rval = ETIME; /* timed out */
+ break;
+ }
+ bmicrosleep(1, 0); /* wait one second */
+ remaining_wait--;
+ } else if (exitCode != 0) {
+ /* Truncate exit code as it doesn't seem to be correct */
+ rval = (exitCode & 0xFF) | b_errno_exit;
+ break;
+ } else {
+ break; /* Shouldn't get here */
+ }
+ }
+
+ if (bpipe->timer_id) {
+ stop_child_timer(bpipe->timer_id);
+ }
+ if (bpipe->rfd) fclose(bpipe->rfd);
+ if (bpipe->wfd) fclose(bpipe->wfd);
+ free((void *)bpipe);
+ return rval;
}
int
; winbacula.nsi
;
-; Written by Michel Meyers (michel@tcnnet.dyndns.org)
+; Began as a version written by Michel Meyers (michel@tcnnet.dyndns.org)
;
-; Updated by Kern Sibbald for native Win32 Bacula
+; Adapted by Kern Sibbald for native Win32 Bacula
; added a number of elements from Christopher Hull's installer
;
; D. Scott Barninger Nov 13 2004
; added Start Menu items
; fix uninstall of config files to do all not just bacula-fd.conf
;
+; D. Scott Barninger Dec 05 2004
+; added specification of default permissions for bacula-fd.conf
+; - thanks to Jamie Ffolliott for pointing me at cacls
+; added removal of working-dir files if user selects to remove config
+; uninstall is now 100% clean
+;
+; D. Scott Barninger Apr 17 2005
+; 1.36.3 release docs update
+; add pdf manual and menu shortcut
+;
; Command line options:
;
; /cygwin - do cygwin install into c:\cygwin\bacula
Call IsNt
Pop $R0
StrCmp $R0 "false" do_win98
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to start the Bacula Client now?" IDNO NoStart
+ MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to start the Bacula Client now?" IDNO SetPerms
Exec 'net start bacula'
+ SetPerms:
+ ; set default permissions on config file so it's not world readable
+ Exec 'cmd /C echo Y|cacls "$INSTDIR\bin\bacula-fd.conf" /G SYSTEM:F Administrators:F'
goto NoStart
do_win98:
File Start.bat
Section "Install Documentation" SecDoc
SetOutPath "$INSTDIR\doc"
CreateDirectory "$INSTDIR\doc"
- File ..\..\doc\html-manual\*.html
- File ..\..\doc\html-manual\*.gif
- File ..\..\doc\html-manual\*.jpg
+ File ..\..\doc\latex\bacula\*.html
+ File ..\..\doc\latex\bacula\*.png
+ File ..\..\doc\latex\bacula\*.css
+ File ..\..\doc\latex\bacula.pdf
+ ; Create Start Menu entry
+ SetShellVarContext all
+ CreateShortCut "$SMPROGRAMS\Bacula\Manual.lnk" "$INSTDIR\doc\bacula.pdf"
SectionEnd
;
Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
; Check for existing installation
- MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to delete the current configuration files?" IDNO LeaveConfig
+ MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to delete the current configuration files and the working state file?" IDNO LeaveConfig
Delete /REBOOTOK "$INSTDIR\bin\*.conf"
+ Delete /REBOOTOK "$INSTDIR\working\*"
; remove directories used
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR\doc"
+24-03-2005 :
+ - wxbMainFrame : Fix a bug with GTK+-1.2 which caused wx-console to crash
+ when starting.
+ - wxbRestorePanel : Fix a major bug which caused wx-console to enter in an
+ infinite loop which allocate a lot of memory and could make the system crash.
+
+10-03-2005 :
+ - wxbMainFrame : Fix bug #0000221 (Debian 292517)
+
13-08-2004 :
- wxbHistoryTextCtrl : Fixed Win32 build error
- general : implemented command completion and interactive help.
$(RMF) Makefile.bak; \
else \
$(MV) Makefile.bak Makefile; \
- echo -e "Something went wrong\n\a"; \
+ echo " ===== Something went wrong in make depend ====="; \
fi
# -----------------------------------------------------------------------
}
switch (type) {
case R_CONSOLE:
- printf("Console: name=%s rcfile=%s histfile=%s\n", reshdr->name,
+ printf("Console: name=%s rcfile=%s histfile=%s\n", reshdr->name,
res->res_cons.rc_file, res->res_cons.hist_file);
break;
case R_DIRECTOR:
- printf("Director: name=%s address=%s DIRport=%d\n", reshdr->name,
+ printf("Director: name=%s address=%s DIRport=%d\n", reshdr->name,
res->res_dir.address, res->res_dir.DIRport);
break;
default:
- printf("Unknown resource type %d\n", type);
+ printf("Unknown resource type %d\n", type);
}
if (recurse && res->res_dir.hdr.next) {
dump_resource(type, res->res_dir.hdr.next, sendit, sock);
free(res->res_dir.address);
break;
default:
- printf("Unknown resource type %d\n", type);
+ printf("Unknown resource type %d\n", type);
}
/* Common stuff again -- free the resource, recurse to next one */
free(res);
for (i=0; items[i].name; i++) {
if (items[i].flags & ITEM_REQUIRED) {
if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {
- Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n",
+ Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n",
items[i].name, resources[rindex]);
}
}
break;
default:
- Emsg1(M_ERROR, 0, "Unknown resource type %d\n", type);
+ Emsg1(M_ERROR, 0, "Unknown resource type %d\n", type);
error = 1;
break;
}
size = sizeof(DIRRES);
break;
default:
- printf("Unknown resource type %d\n", type);
+ printf("Unknown resource type %d\n", type);
error = 1;
size = 1;
break;
for (next=res_head[rindex]; next->next; next=next->next) {
if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
Emsg2(M_ERROR_TERM, 0,
- _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
+ _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
resources[rindex].name, res->res_dir.hdr.name);
}
}
next->next = (RES *)res;
- Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
+ Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
res->res_dir.hdr.name);
}
}
void* Entry();
void Write(const char* str);
virtual void Delete();
-
+
static void InitLib();
static void FreeLib();
static wxString LoadConfig(wxString configfile);
private:
static bool inited;
static bool configloaded;
-
+
bool choosingdirector;
-
+
static wxString working_dir;
-
+
int directorchoosen;
-
+
BSOCK* UA_sock;
JCR jcr;
};
class wxbConfigFileEditor : public wxDialog {
public:
- wxbConfigFileEditor(wxWindow* parent, wxString filename);
- virtual ~wxbConfigFileEditor();
+ wxbConfigFileEditor(wxWindow* parent, wxString filename);
+ virtual ~wxbConfigFileEditor();
private:
wxString filename;
-
+
wxTextCtrl* textCtrl;
-
+
void OnSave(wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
-
+
DECLARE_EVENT_TABLE()
};
};
class wxbConfigParam {
- public:
+ public:
/* Create a new config parameter */
wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, wxString value);
wxbConfigParam(wxString title, wxWindowID id, wxbConfigType type, int n, wxString values[]);
~wxbConfigParam();
-
+
void AddControl(wxWindow* parent, wxSizer* sizer);
-
+
wxString GetValue();
void SetValue(wxString str);
-
+
int GetIndex();
void SetIndex(int ind);
-
+
void Clear();
void Add(wxString value);
-
+
wxString GetTitle();
-
+
private:
wxString value;
wxString* values;
int nvalues;
-
+
wxString title;
-
+
wxWindowID id;
-
+
wxbConfigType type;
-
+
wxChoice* choicectrl;
wxTextCtrl* textctrl;
wxStaticText* statictext;
class wxbConfigPanel : public wxPanel {
public:
/* Creates a new config panel, config must be allocated with new */
- wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
- ~wxbConfigPanel();
-
+ wxbConfigPanel(wxWindow* parent, wxbConfig* config, wxString title, wxWindowID ok, wxWindowID cancel, wxWindowID apply = -1);
+ ~wxbConfigPanel();
+
void SetRowString(const char* title, wxString value);
wxString GetRowString(const char* title);
int GetRowSelection(const char* title);
wxButton* cfgOk;
wxButton* cfgCancel;
wxButton* cfgApply;
-
+
int FindRow(const char* title);
};
class wxbHistoryTextCtrl: public wxTextCtrl {
public:
wxbHistoryTextCtrl(wxStaticText* help, wxWindow* parent, wxWindowID id,
- const wxString& value = "", const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxTextCtrlNameStr);
+ const wxString& value = "", const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxTextCtrlNameStr);
void HistoryAdd(wxString cmd);
#define EVT_LIST_MARKED_EVENT(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
- wxbLIST_MARKED_EVENT, id, wxID_ANY, \
- (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
- (wxObject *) NULL \
+ wxbLIST_MARKED_EVENT, id, wxID_ANY, \
+ (wxObjectEventFunction)(wxEventFunction)(wxListMarkedEventFunction)&fn, \
+ (wxObject *) NULL \
),
/* Customized list, which transmit double clicks on images */
public:
wxbListCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
~wxbListCtrl();
-
+
private:
void OnDoubleClicked(wxMouseEvent& event);
void OnRightClicked(wxMouseEvent& event);
-
+
wxEvtHandler* handler;
-
+
DECLARE_EVENT_TABLE();
};
wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(NULL, -1, title, pos, size, style)
{
+ lockedbyconsole = false;
+
ct = NULL;
promptparser = NULL;
this->SetSize(size);
EnableConsole(false);
- lockedbyconsole = false;
-
consoleBuffer = "";
configfile = "";
int res = ::wxGetSingleChoiceIndex(message,
"wx-console: unexpected director's question.", n, choices, this);
- if (res == -1) {
- Send("\n");
+ if (res == -1) { //Cancel pressed
+ Send(".\n");
}
else {
if (promptparser->isNumericalChoice()) {
wxString str;
int status;
wxbPrintObject(wxString str, int status): wxObject() {
- this->str = str;
- this->status = status;
+ this->str = str;
+ this->status = status;
}
wxbPrintObject(const wxbPrintObject& pe) {
- this->str = pe.str;
- this->status = pe.status;
+ this->str = pe.str;
+ this->status = pe.status;
}
};
/* Enable and disable panels */
void EnablePanels();
void DisablePanels(void* except = NULL);
-
+
void EnableConsole(bool enable = true);
/*
* If config is not empty, uses this config file.
*/
void StartConsoleThread(const wxString& config);
-
+
/* Register a new wxbDataParser */
void Register(wxbDataParser* dp);
-
+
/* Unregister a wxbDataParser */
void Unregister(wxbDataParser* dp);
/* private constructor, singleton */
wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style);
~wxbMainFrame();
-
+
static wxbMainFrame *frame; /* this */
wxMenu *menuFile;
wxbPromptParser* promptparser; /* prompt parser catching uncatched questions */
bool lockedbyconsole; /* true if the panels have been locked by something typed in the console */
-
+
wxString configfile; /* configfile used */
-
+
wxString consoleBuffer; /* Buffer used to print in the console line by line */
-
+
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
};
SetCursor(*wxSTANDARD_CURSOR);
- markWhenListingDone = false;
+ markWhenCommandDone = false;
cancelled = 0;
}
void wxbRestorePanel::OnStart(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
SetWorking(true);
void wxbRestorePanel::OnTreeChanging(wxTreeEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
event.Veto();
}
}
void wxbRestorePanel::OnTreeExpanding(wxTreeEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
event.Veto();
return;
}
void wxbRestorePanel::OnTreeChanged(wxTreeEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
if (currentTreeItem == event.GetItem()) {
treeadd->Enable(false);
treeremove->Enable(false);
treerefresh->Enable(false);
- markWhenListingDone = false;
+ markWhenCommandDone = false;
SetWorking(true);
currentTreeItem = event.GetItem();
CmdList(event.GetItem());
- if (markWhenListingDone) {
+ if (markWhenCommandDone) {
CmdMark(event.GetItem(), NULL, 0);
tree->Refresh();
}
}
void wxbRestorePanel::OnTreeMarked(wxbTreeMarkedEvent& event) {
- csprint("Tree marked", CS_DEBUG);
if (IsWorking()) {
if (tree->GetSelection() == event.GetItem()) {
- markWhenListingDone = !markWhenListingDone;
+ markWhenCommandDone = !markWhenCommandDone;
}
- AddPendingEvent(event);
return;
}
SetWorking(true);
+ markWhenCommandDone = false;
CmdMark(event.GetItem(), NULL, 0);
- //event.Skip();
+ if (markWhenCommandDone) {
+ CmdMark(event.GetItem(), NULL, 0);
+ tree->Refresh();
+ }
tree->Refresh();
SetWorking(false);
if (event.GetItem().IsOk()) {
void wxbRestorePanel::OnTreeAdd(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnTreeRemove(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnTreeRefresh(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnListMarked(wxbListMarkedEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
- //event.Skip();
return;
}
num++;
item = list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
}
-
+
CmdMark(wxTreeItemId(), items, num);
delete[] items;
void wxbRestorePanel::OnListActivated(wxListEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
- //event.Skip();
return;
}
SetWorking(true);
void wxbRestorePanel::OnListChanged(wxListEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnListAdd(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnListRemove(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
void wxbRestorePanel::OnListRefresh(wxCommandEvent& event) {
if (IsWorking()) {
- AddPendingEvent(event);
return;
}
bool working; // A command is running, discard GUI events
void SetWorking(bool working);
bool IsWorking();
- bool markWhenListingDone;
+ bool markWhenCommandDone; //If an item should be (un)marked after the current listing/marking is done
wxTreeItemId currentTreeItem; // Currently selected tree item
/* Enable or disable config controls status */
#include <wx/dynarray.h>
-/*
- * Allow the use of Object Array (auto-deletion, object returned as themselves
+/*
+ * Allow the use of Object Array (auto-deletion, object returned as themselves
* and not as pointers)
*/
class wxbArrayString: public wxArrayString, public wxObject {
~wxbTreeMarkedEvent();
wxbTreeMarkedEvent(const wxbTreeMarkedEvent& te);
virtual wxEvent *Clone() const;
-
+
wxTreeItemId GetItem();
private:
wxTreeItemId item;
#define EVT_TREE_MARKED_EVENT(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
- wxbTREE_MARKED_EVENT, id, wxID_ANY, \
- (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
- (wxObject *) NULL \
+ wxbTREE_MARKED_EVENT, id, wxID_ANY, \
+ (wxObjectEventFunction)(wxEventFunction)(wxTreeMarkedEventFunction)&fn, \
+ (wxObject *) NULL \
),
/* Customized tree, which transmit double clicks on images */
public:
wxbTreeCtrl(wxWindow* parent, wxEvtHandler* handler, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
~wxbTreeCtrl();
-
+
private:
void OnDoubleClicked(wxMouseEvent& event);
void OnRightClicked(wxMouseEvent& event);
-
+
wxEvtHandler* handler;
-
+
DECLARE_EVENT_TABLE();
};
public:
/* Initialization */
static void Init();
-
+
/* Reset state */
static void Reset();
-
+
/* Parse a table in tableParser */
static wxbTableParser* CreateAndWaitForParser(wxString cmd);
/*
* Receives director information, forwarded by wxbMainFrame, and sends it
* line by line to the virtual function Analyse.
- *
+ *
* Returns true if status == CS_PROMPT and the message has been parsed
* correctly.
*/
* Tab title in the notebook.
*/
virtual wxString GetTitle() = 0;
-
+
/*
* Enable or disable this panel
*/
/*
* Receives director information, and splits it by line.
- *
+ *
* datatokenizer[0] retrieves first line
*/
class wxbDataTokenizer: public wxbDataParser, public wxArrayString
* Receives data to analyse.
*/
virtual bool Analyse(wxString str, int status);
-
- /* Returns true if the last signal received was an end signal,
+
+ /* Returns true if the last signal received was an end signal,
* indicating that no more data is available */
bool hasFinished();
-
+
private:
bool finished;
};
* Receives data to analyse.
*/
virtual bool Analyse(wxString str, int status);
-
- /* Returns true if the last signal received was an prompt signal,
+
+ /* Returns true if the last signal received was an prompt signal,
* or an end signal */
bool hasFinished();
-
+
/* Returns true if the last message received is a prompt message */
bool isPrompt();
/* Returns question string */
wxString getQuestionString();
-
+
/* Returns a wxArrayString containing the indexed choices we have
* to answer the question, or NULL if this question is not a multiple
* choice one. */
wxArrayString* getChoices();
-
+
/* Returns true if the expected answer to the choice list is a number,
* false if it is a string (for example yes/mod/no). */
bool isNumericalChoice();
-
+
private:
bool finished;
bool prompt;
- bool numerical;
+ bool numerical;
wxString introStr;
wxArrayString* choices;
wxString questionStr;
+++ /dev/null
-build
-bin
-test.out
-weird-files
-weird-files2
-diff
-tmp
-working
-Makefile
+++ /dev/null
-#
-# Makefile for Bacula regression testing
-#
-# Note, Makefile is built from Makefile.in, which you should not really
-# need to change, by envoking:
-#
-# ./config <user's configuration>
-# e.g.
-#
-# ./config kern.conf
-#
-#
-
-# suck in user's configuration
-@CONFIG@
-
-WHICHDB?="--with-sqlite=${SQLITE_DIR}"
-
-first_rule: all
-
-all:
-
-setup: bacula
-
-#
-# Some machines cannot handle the sticky bit and other garbage that
-# is in weird-files, so we load and run it only on Linux machines.
-#
-bacula: all
- @rm -rf bin build weird-files tmp
- (if test x`uname` = xLinux -o x`uname` = xFreeBSD ; then \
- tar xfz weird-files.tar.gz ;\
- fi)
- rm -rf tmp working
- mkdir tmp working
- scripts/setup ${BACULA_SOURCE} ${EMAIL} ${WHICHDB}
- scripts/do_sed ${EMAIL} ${TAPE_DRIVE} ${AUTOCHANGER} ${AUTOCHANGER_PATH}
-
-# Run all non-root userid tests
-test:
- ./all-non-root-tests
-
-# run all file and tape tests
-full_test:
- ./all-tape-and-file-tests
-
-# These tests require you to run as root
-root_test:
- ./all-root-tests
-
-clean:
- scripts/cleanup
- rm -f /tmp/file-list
- rm -f tmp/* working/*
- rm -f test.out
- rm -f diff
- rm -f 1 2 3 scripts/1 scripts/2 scripts/3 tests/1 tests/2 tests/3
-
-# Reset our userid after running as root
-reset:
- chown -R ${USER}:${USER} . tmp working
- scripts/cleanup
- rm -f /tmp/file-list tmp/file-list
- rm -f tmp/* working/*
-
-distclean: clean
- rm -rf bin build weird-files weird-files weird-files2 tmp working
- rm -f scripts/*.conf
-
+++ /dev/null
- Bacula Regression
- Kern Sibbald
- December 2003
-
-This is Bacula's regression script directory. At this time
-(December 2003), it is still in development, so all the tests are
-not complete.
-
-To set it up, create your personal configuration file, by
-copying prototype.conf to xxx.conf or simply editing prototype.conf
-directly.
-
-Then edit your conf file and define appropriate values
-for the variables that are in that file. If you want to see
-a real example, look at kern.conf, but please don't use my
-email address!
-
-Make sure that depkgs is pre-built if it isn't
-already: (cd your-depkgs; make sqlite).
-
-Then do:
-
- ./config xxx.conf
- make setup
-
-You run the above one time. This will build a Makefile from
-Makefile.in and your xxx.conf file, copy the Bacula source,
-configure, build it, and configure all the Bacula scripts
-and conf files. If you change your source, you will need to
-redo this command.
-
-Then you can run any of the tests in the tests subdirectory.
-Each test whose name ends in -root requires you to be root for
-a resonable run. Each test is totally independent of any other
-test. Aside from the required "make setup", each test is totally
-self-initalizing and should clean up after itself.
-
-Not all the tests yet report OK. This is simply because there are
-some spurious differences that I haven't yet taken the time to
-eliminate. The working scrips as of 24 Apr 03 are:
-
-backup-bacula-test
-sparse-test
-compressed-test
-sparse-compressed-test
-two-jobs-test
-wierd-files-test
-verify-vol-test
-
-The tests expect you to execute them from the main regress
-directory!
-
-You can run them individually as:
-
- tests/two-jobs-test
-
-or all non-root tests (my normal testing under my account)
-
- ./all-non-root-tests
-
-or all tests (I only run these before a production release):
-
- su
- ./all-tests
-
-
-after running the root tests, while still root, it is a good idea
-to do:
-
- make reset
-
-this cleans up any files that may be created with root permissions.
-
-If you want to add more tests, do so by putting the shell script
-in the tests subdirectory. Be careful when adding (or better not)
-new clients, pools, and such to the test-bacula-dir.conf.in file
-as it may invalidate a good number of tests, which respond to
-questions by answering with a number (i.e. the order of the selection
-list is known). It might be better to add your own testb-bacula...
-configuration file.
-
-To avoid re-doing a make setup if you have made a change to the
-conf files, and you do not need a new copy of the source, you can simply do:
-
- scripts/do-sed <your-email-address>
-
-Debugging failed tests:
-The simplest thing to do is to edit tests/xxxx where xxxx is the name of
-a or the test that is failing and change all:
-
- @output
-
-to
-
- @tee
-
-re-run the test. The output will display on your terminal. In rare cases,
-for example to get bacula debug output, you might want to remove the
-"2>&1 >/dev/null" from the end of the bin/bacula call or from the end
-of the diff call, assuming you want to "see" the diff output.
-
+++ /dev/null
-#!/bin/sh
-#
-# Run all tape tests
-#
-tests/test0
-tests/two-volume-tape
-tests/incremental-2tape
-echo " "
-echo " "
-echo "2 Tape Test results"
-cat test.out
-scripts/cleanup
+++ /dev/null
-#!/bin/sh
-#
-# Run all tape tests
-#
-tests/test0
-tests/backup-bacula-tape
-tests/small-file-size-tape
-tests/restore-by-file-tape
-tests/incremental-tape
-tests/four-concurrent-jobs-tape
-tests/four-jobs-tape
-tests/fixed-block-size-tape
-tests/bscan-tape
-tests/btape-fill-tape
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
+++ /dev/null
-#!/bin/sh
-#
-# Run all tests
-#
-tests/test0
-tests/backup-bacula-test
-tests/verify-vol-test
-tests/sparse-test
-tests/compressed-test
-tests/sparse-compressed-test
-tests/weird-files-test
-tests/two-jobs-test
-tests/two-vol-test
-tests/six-vol-test
-tests/bscan-test
-tests/weird-files2-test
-tests/concurrent-jobs-test
-tests/four-concurrent-jobs-test
-tests/bsr-opt-test
-tests/bextract-test
-tests/recycle-test
-tests/span-vol-test
-tests/restore-by-file-test
-tests/restore2-by-file-test
-tests/four-jobs-test
-tests/incremental-test
-tests/decremental-test
-tests/restore-disk-seek-test
-tests/query-test
-tests/auto-label-test
-echo " "
-echo " "
-echo "Test results"
-cat test.out
-scripts/cleanup
+++ /dev/null
-#!/bin/sh
-#
-# Run all root tests
-#
-rm -f test.out
-tests/dev-test-root
-tests/etc-test-root
-tests/lib-test-root
-tests/usr-tape-root
-cat test.out
-scripts/cleanup
+++ /dev/null
-#!/bin/sh
-#
-# Run all tests
-#
-./all-non-root-tests
-./all-non-root-tape-tests
+++ /dev/null
-#!/bin/sh
-#
-# Run all tests
-#
-./all-non-root-tests
-./all-root-tests
-cat test.out
-scripts/cleanup
+++ /dev/null
-#/bin/sh
-#
-# First argument is expected to be a user's configuration file
-#
-if ! test -e $1 ; then
- echo "Arg1 must specify a config file (e.g. prototype.conf)"
- exit 1
-fi
-sed -e "/@CONFIG@/r $1" -e "s/@CONFIG@//" Makefile.in >Makefile
+++ /dev/null
-#!/bin/sh
-make setup
-./all-tape-and-file-tests
+++ /dev/null
-#!/bin/sh
-make setup
-./all-non-root-tape-tests
+++ /dev/null
-#!/bin/sh
-./all-non-root-tests
+++ /dev/null
-# Where to get the source to be tested
-BACULA_SOURCE="${HOME}/bacula/k"
-
-# Where to send email !!!!! Change me !!!!!!!
-EMAIL=kern@sibbald.com
-
-# Full "default" path where to find sqlite (no quotes!)
-SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
-
-TAPE_DRIVE="/dev/nst0"
-# if you don't have an autochanger set AUTOCHANGER to /dev/null
-AUTOCHANGER="/dev/sg0"
-
-# This must be the path to the autochanger including its name
-AUTOCHANGER_PATH="/usr/local/bin/mtx"
+++ /dev/null
-#
-# Prototype personal configuration file for the regression
-# scripts. Either edit this file directly, or better copy
-# it elsewhere so it won't get overwritten.
-#
-
-#
-# Where to get the source to be tested
-#
-BACULA_SOURCE=
-
-# Where to send email messages
-#
-EMAIL=
-
-# Full "default" path where to find sqlite.
-# This is only used if you do not specify a database override on the
-# make command.
-#
-# N.B. DON'T PUT QOUTES AROUND THE PATH.
-#
-SQLITE_DIR=${HOME}/bacula/depkgs/sqlite
-
-#
-# The device name of your tape drive if you have one
-#
-TAPE_DRIVE=/dev/nst0
-
-#
-# if you don't have an autochanger set AUTOCHANGER to /dev/null
-#
-AUTOCHANGER=/dev/sg0
-
-#
-# This must be the path to the autochanger including its name
-#
-AUTOCHANGER_PATH=/bin/mtx
+++ /dev/null
-#!/bin/sh
-bin/bacula start
-bin/bconsole -c bin/bconsole.conf
+++ /dev/null
-new-test-bacula-dir.conf
-bacula-dir.conf
-bacula-fd.conf
-bacula-sd.conf
-console.conf
-bconsole.conf
-test-bacula-dir.conf
-test-bacula-fd.conf
-test-bacula-sd.conf
-test-console.conf
-testa-bacula-dir.conf
-bacula-dir-tape.conf
-bacula-sd-tape.conf
-bacula-sd-2tape.conf
-cleanup-tape
-cleanup-2tape
-prepare-two-tapes
+++ /dev/null
-#
-# Default Bacula Director Configuration file
-#
-# The only thing that MUST be changed is to add one or more
-# file or directory names in the Include directive of the
-# FileSet resource.
-#
-# For Bacula release 1.33
-#
-# You might also want to change the default email address
-# from root to your address. See the "mail" and "operator"
-# directives in the Messages resource.
-#
-
-Director { # define myself
- Name = @hostname@-dir
- DIRport = 8101 # where we listen for UA connections
- QueryFile = "@scriptdir@/query.sql"
- WorkingDirectory = "@working_dir@"
- PidDirectory = "@piddir@"
- Maximum Concurrent Jobs = 4
- Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
- Messages = Daemon
-}
-
-#
-# Define the main nightly save backup job
-# By default, this job will back up to disk in /tmp
-Job {
- Name = "NightlySave"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = DDS-4
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
- Maximum Concurrent Jobs = 4
- SpoolData = yes
-}
-
-
-# Standard Restore template, to be changed by Console program
-Job {
- Name = "RestoreFiles"
- Type = Restore
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = DDS-4
- Messages = Standard
- Pool = Default
- Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
- Name = "Full Set"
- Include = signature=MD5 {
- </tmp/file-list
- }
-}
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-# differential (i.e. incremental since full) every other sunday,
-# and incremental backups other days
-Schedule {
- Name = "WeeklyCycle"
- Run = Full 1st sun at 1:05
- Run = Differential 2nd-5th sun at 1:05
- Run = Incremental mon-sat at 1:05
-}
-
-# Client (File Services) to backup
-Client {
- Name = @hostname@-fd
- Address = @hostname@
- FDPort = 8102
- Catalog = MyCatalog
- Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
- File Retention = 30d # 30 days
- Job Retention = 180d # six months
- AutoPrune = yes # Prune expired Jobs/Files
- Maximum Concurrent Jobs = 4
-}
-
-# Definition of DDS tape storage device
-Storage {
- Name = DDS-4
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
- Device = DDS-4 # must be same as Device in Storage daemon
- Media Type = DDS-4 # must be same as MediaType in Storage daemon
- AutoChanger = yes
- Maximum Concurrent Jobs = 4
-}
-
-
-# Generic catalog service
-Catalog {
- Name = MyCatalog
- dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-# and to the console
-Messages {
- Name = Standard
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
- MailOnError = @job_email@ = all, !terminate
- operator = @job_email@ = mount
- console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
-#
- append = "@working_dir@/log" = all, !skipped
-}
-
-#
-# Message delivery for daemon messages (no job).
-Messages {
- Name = Daemon
- mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
- mail = @job_email@ = all, !skipped
- console = all, !skipped, !saved
- append = "@working_dir@/log" = all, !skipped
-}
-
-
-# Default pool definition
-Pool {
- Name = Default
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
- Accept Any Volume = yes # write on any volume in the pool
-}
+++ /dev/null
-#
-# Default Bacula Storage Daemon Configuration file
-#
-# For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-# on the "Archive Device" directive in the Device
-# resource. If you change the Name and/or the
-# "Media Type" in the Device resource, please ensure
-# that dird.conf has corresponding changes.
-#
-
-Storage { # definition of myself
- Name = @hostname@-sd
- SDPort = 8103 # Director's port
- WorkingDirectory = "@working_dir@"
- Pid Directory = "@piddir@"
- Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
- Name = @hostname@-dir
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-# same Name and MediaType.
-#
-
-Device {
- Name = DDS-4 #
- Media Type = DDS-4
- Changer Device = @autochanger@
- Changer Command ="@scriptdir@/mtx-changer %c %o %S %a"
- Archive Device = @tape_drive@
- AutomaticMount = yes; # when device opened, read it
- AlwaysOpen = yes;
- RemovableMedia = yes;
- @@sbindir@/tape_options
-# Maximum File Size = 1000000
-}
-
-#
-# Send all messages to the Director,
-# mount messages also are sent to the email address
-#
-Messages {
- Name = Standard
- director = @hostname@-dir = all, !terminate
-}
+++ /dev/null
-#
-# Default Bacula Storage Daemon Configuration file
-#
-# For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-# on the "Archive Device" directive in the Device
-# resource. If you change the Name and/or the
-# "Media Type" in the Device resource, please ensure
-# that dird.conf has corresponding changes.
-#
-
-Storage { # definition of myself
- Name = @hostname@-sd
- SDPort = 8103 # Director's port
- WorkingDirectory = "@working_dir@"
- Pid Directory = "@piddir@"
- Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
- Name = @hostname@-dir
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-# same Name and MediaType.
-#
-
-Device {
- Name = DDS-4 #
- Media Type = DDS-4
- Archive Device = @tape_drive@
- AutomaticMount = yes; # when device opened, read it
- AlwaysOpen = yes;
- RemovableMedia = yes;
- @@sbindir@/tape_options
-# Maximum File Size = 1000000
-# MaximumVolumeSize = 100M
-}
-
-#
-# Send all messages to the Director,
-# mount messages also are sent to the email address
-#
-Messages {
- Name = Standard
- director = @hostname@-dir = all, !terminate
-}
+++ /dev/null
-#
-# Default Bacula Storage Daemon Configuration file
-#
-# For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-# on the "Archive Device" directive in the Device
-# resource. If you change the Name and/or the
-# "Media Type" in the Device resource, please ensure
-# that dird.conf has corresponding changes.
-#
-
-Storage { # definition of myself
- Name = rufus-sd
- SDPort = 8103 # Director's port
- WorkingDirectory = "/home/kern/bacula/regress/working"
- Pid Directory = "/home/kern/bacula/regress/working"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
- Name = rufus-dir
- Password = "BzlEl8haeFmnv/Lv8V6zDzUBgFFQNsUtny6VkmccQpOy"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-# same Name and MediaType.
-#
-
-Device {
- Name = FileStorage
- Media Type = File
- Archive Device = @tmpdir@
- LabelMedia = yes; # lets Bacula label unlabeled media
- Random Access = Yes;
- AutomaticMount = yes; # when device opened, read it
- RemovableMedia = no;
- AlwaysOpen = no;
-}
-
-#Device {
-# Name = DDS-4 #
-# Media Type = DDS-4
-# Archive Device = /dev/nst0
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = yes;
-# RemovableMedia = yes;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-# Name = "Exabyte 8mm"
-# Media Type = "8mm"
-# Archive Device = /dev/nst0
-# Hardware end of medium = No;
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = Yes;
-# RemovableMedia = yes;
-#}
-
-#
-# Send all messages to the Director,
-# mount messages also are sent to the email address
-#
-Messages {
- Name = Standard
- director = rufus-dir = all, !terminate
-}
+++ /dev/null
-#!/bin/sh
-#
-# Check for zombie jobs (not terminated).
-# Also scan logs for ERROR messages
-#
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output tmp/dir.out
-status dir
-@output tmp/fd.out
-status client
-@output tmp/sd.out
-status $1
-@output
-quit
-END_OF_DATA
-grep "No Jobs running." tmp/dir.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " !!!! Zombie Jobs in Director !!!!"
- echo " !!!! Zombie Jobs in Director !!!!" >>test.out
- echo " "
-fi
-grep "No Jobs running." tmp/fd.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " !!!! Zombie Jobs in File daemon !!!!"
- echo " !!!! Zombie Jobs in File daemon !!!!" >>test.out
- echo " "
-fi
-grep "No Jobs running." tmp/sd.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " !!!! Zombie Jobs in Storage daemon !!!!"
- echo " !!!! Zombie Jobs in Storage daemon !!!!" >>test.out
- echo " "
-fi
-grep "ERROR" tmp/log*.out 2>&1 >/dev/null
-if [ $? = 0 ] ; then
- echo " "
- echo " !!!! ERROR in log output !!!!"
- echo " !!!! ERROR in log output !!!!" >>test.out
- echo " "
-fi
-grep "Fatal Error" tmp/log*.out 2>&1 >/dev/null
-if [ $? = 0 ] ; then
- echo " "
- echo " !!!! Fatal Error in log output !!!!"
- echo " !!!! Fatal Error in log output !!!!" >>test.out
- echo " "
-fi
-
-
+++ /dev/null
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-rm -rf /tmp/TestVolume001 /tmp/bacula-restores /tmp/Small*
-rm -rf tmp/original tmp/bacula-restores tmp/Small* tmp/TestVolume*
-rm -rf tmp/restored tmp/largefile tmp/bscan.bsr tmp/log*.out
-rm -rf /tmp/sed_tmp /tmp/file-list
-rm -rf tmp/build tmp/restore-list tmp/restore2-list
-rm -rf tmp/fd.out tmp/dir.out tmp/sd.out
-rm -rf working/log tmp/TEST-*
-
-bin/bacula stop 2>&1 >/dev/null
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges >/dev/null 2>&1
-cd ..
+++ /dev/null
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-scripts/cleanup
-
-if ! test x@autochanger@ = x/dev/null; then
- drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x2; then
- bin/mtx-changer @autochanger@ unload
- bin/mtx-changer @autochanger@ load 2
- fi
- mt -f @tape_drive@ rewind
- mt -f @tape_drive@ weof
-fi
-
-
-#
-# If we have an autochanger always load tape in slot 1
-#
-if ! test x@autochanger@ = x/dev/null; then
- drive=`bin/mtx-changer @autochanger@ loaded`
- if ! test x$drive = x1; then
- bin/mtx-changer @autochanger@ unload
- bin/mtx-changer @autochanger@ load 1
- fi
-fi
-
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
+++ /dev/null
-#!/bin/sh
-#
-# Cleanup left over files -- both before and after test run
-#
-scripts/cleanup
-
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
+++ /dev/null
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-2tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+++ /dev/null
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/bconsole.conf bin/bconsole.conf
+++ /dev/null
-#!/bin/sh
-/bin/cp -f scripts/bacula-dir-tape.conf bin/bacula-dir.conf
-/bin/cp -f scripts/bacula-sd-tape.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+++ /dev/null
-#!/bin/sh
-/bin/cp -f scripts/new-test-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+++ /dev/null
-#!/bin/sh
-/bin/cp -f scripts/testa-bacula-dir.conf bin/bacula-dir.conf
-/bin/cp -f scripts/test-bacula-sd.conf bin/bacula-sd.conf
-/bin/cp -f scripts/test-bacula-fd.conf bin/bacula-fd.conf
-/bin/cp -f scripts/test-console.conf bin/bconsole.conf
+++ /dev/null
-#!/bin/sh
-#
-if test $# != 4 ; then
- echo "First arg must be email name"
- echo " and the second must be a tape drive"
- echo " and the third must be a tape control name or /dev/null"
- echo " and the fourth must be the full path to the mtx program"
- exit 1
-fi
-out="/tmp/sed_tmp"
-cwd=`pwd`
-host=`hostname | tr '.' ' ' | cut -f 1 -d ' '`
-if test x$host = x ; then
- host=localhost
-fi
-# Create sed command script
-echo "s%@sbindir@%${cwd}/bin%g" >${out}
-echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
-echo "s%@working_dir@%${cwd}/working%g" >>${out}
-echo "s%@piddir@%${cwd}/working%g" >>${out}
-echo "s%@subsysdir@%${cwd}/working%g" >>${out}
-echo "s%@job_email@%${1}%g" >>${out}
-echo "s%@tape_drive@%${2}%g" >>${out}
-echo "s%@autochanger@%${3}%g" >>${out}
-echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
-echo "s%@hostname@%${host}%g" >>${out}
-echo "s%@changer_path@%${4}%g" >>${out}
-
-# process .in files with sed script
-sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
-sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
-sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
-sed -f ${out} ${cwd}/scripts/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
-sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
-sed -f ${out} ${cwd}/scripts/cleanup-2tape.in >${cwd}/scripts/cleanup-2tape
-sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
-cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$
-sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 777 ${cwd}/scripts/cleanup-*tape ${cwd}/scripts/prepare-two-tapes
-rm -f /tmp/bac$$
-cp ${cwd}/bin/mtx-changer /tmp/bac$$
-sed "s%^MTX.*$%MTX=${4}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
-chmod 777 ${cwd}/bin/mtx-changer
-
-# get proper SD tape definitions
-if test x`uname` = xLinux ; then \
- cp -f scripts/linux_tape_options bin/tape_options ; \
-fi
-if test x`uname` = xFreeBSD ; then \
- cp -f scripts/freebsd_tape_options bin/tape_options ; \
-fi
-
-rm -f ${out}
-rm -f /tmp/bac$$
+++ /dev/null
-dev/ptmx
-dev/pts
-dev/rd/c5d2
-dev/rd
-dev/shm
+++ /dev/null
-etc/mail/statistics
+++ /dev/null
-lib/ld-2.2.5.so
-lib/libtermcap.so.2.0.8
-lib/libc-2.2.5.so
-lib/libnsl-2.2.5.so
-lib/libnss_files-2.2.5.so
+++ /dev/null
-/build/doc/bacula.pdf
-/build/configure
-/build/src/stored/bextract
-/build/src/tools/testfind
-/build/Makefile.in
-/build/src/dird/bacula-dir
-/build/src/console/bconsole
-/build/src/filed/bacula-fd
-/build/src/findlib/find_one.c
-/build/src/jcr.h
-/build/platforms/Makefile.in
-/build/platforms/redhat/Makefile.in
-/build/scripts/Makefile.in
-/build/src/filed/win32/bin/cygwin1.dll
-/build/src/filed/win32/winservice.cpp
-/build/src/filed/restore.c
+++ /dev/null
-#
-# FreeBSD tape drive options
-#
-Hardware End of Medium = no
-Fast Forward Space File = no
-BSF at EOM = yes
-Backward Space Record = no
-TWO EOF = yes
+++ /dev/null
- Minimum Block Size = 32768
- Maximum Block Size = 32768
- Hardware End of Medium = yes
- BSF at EOM = yes
- Fast Forward Space File = yes
- Two EOF = no
-
+++ /dev/null
-# nothing needed for Linux
+++ /dev/null
-#
-# Default Bacula Director Configuration file
-#
-# The only thing that MUST be changed is to add one or more
-# file or directory names in the Include directive of the
-# FileSet resource.
-#
-# For Bacula release 1.33
-#
-# You might also want to change the default email address
-# from root to your address. See the "mail" and "operator"
-# directives in the Messages resource.
-#
-
-Director { # define myself
- Name = @hostname@-dir
- DIRport = 8101 # where we listen for UA connections
- QueryFile = "@scriptdir@/query.sql"
- WorkingDirectory = "@working_dir@"
- PidDirectory = "@piddir@"
- SubSysDirectory = "@subsysdir@"
- Maximum Concurrent Jobs = 4
- Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
- Messages = Standard
-}
-
-#
-# Define the main nightly save backup job
-# By default, this job will back up to disk in /tmp
-Job {
- Name = "NightlySave"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
- Maximum Concurrent Jobs = 4
- SpoolData=yes
-}
-
-Job {
- Name = "MonsterSave"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File1
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
- Name = "VerifyVolume"
- Type = Verify
- Level = VolumeToCatalog
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
- Name = "SparseTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="SparseSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
- Name = "CompressedTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="CompressedSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Maximum Concurrent Jobs = 4
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
- Name = "SparseCompressedTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="SparseCompressedSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-# Backup the catalog database (after the nightly save)
-Job {
- Name = "BackupCatalog"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Catalog"
-# Schedule = "WeeklyCycleAfterBackup"
- Storage = File
- Messages = Standard
- Pool = Default
- # This creates an ASCII copy of the catalog
- RunBeforeJob = "@sbindir@/make_catalog_backup -u bacula"
- # This deletes the copy of the catalog
- RunAfterJob = "@sbindir@/delete_catalog_backup"
- Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
-}
-
-# Standard Restore template, to be changed by Console program
-Job {
- Name = "RestoreFiles"
- Type = Restore
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
- Name = "Full Set"
- Include = signature=MD5 {
- </tmp/file-list
- }
-}
-
-FileSet {
- Name = "SparseSet"
- Include {
- Options {
- signature=MD5 sparse=yes
- }
- File = </tmp/file-list
- }
-}
-
-FileSet {
- Name = "CompressedSet"
- Include {
- Options {
- signature=MD5 compression=GZIP
- }
- File = </tmp/file-list
- }
-}
-
-FileSet {
- Name = "SparseCompressedSet"
- Include {
- Options {
- signature=MD5 compression=GZIP
- }
- File = </tmp/file-list
- }
-}
-
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-# differential (i.e. incremental since full) every other sunday,
-# and incremental backups other days
-Schedule {
- Name = "WeeklyCycle"
- Run = Full 1st sun at 1:05
- Run = Differential 2nd-5th sun at 1:05
- Run = Incremental mon-sat at 1:05
-}
-
-# This schedule does the catalog. It starts after the WeeklyCycle
-Schedule {
- Name = "WeeklyCycleAfterBackup"
- Run = Full sun-sat at 1:10
-}
-
-# This is the backup of the catalog
-FileSet {
- Name = "Catalog"
- Include {
- Options {
- signature=MD5
- }
- File = /home/kern/bacula/regress/bin/working/bacula.sql
- }
-}
-
-# Client (File Services) to backup
-Client {
- Name = @hostname@-fd
- Address = @hostname@
- FDPort = 8102
- Catalog = MyCatalog
- Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
- File Retention = 30d # 30 days
- Job Retention = 180d # six months
- AutoPrune = yes # Prune expired Jobs/Files
- Maximum Concurrent Jobs = 4
-}
-
-# Definiton of file storage device
-Storage {
- Name = File
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage
- Media Type = File
- Maximum Concurrent Jobs = 4
-}
-
-Storage {
- Name = File1
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage1
- Media Type = File1
- Maximum Concurrent Jobs = 4
-}
-
-
-# Definition of DLT tape storage device
-#Storage {
-# Name = DLTDrive
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
-# Device = "HP DLT 80" # must be same as Device in Storage daemon
-# Media Type = DLT8000 # must be same as MediaType in Storage daemon
-#}
-
-# Definition of DDS tape storage device
-#Storage {
-# Name = SDT-10000
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
-# Device = SDT-10000 # must be same as Device in Storage daemon
-# Media Type = DDS-4 # must be same as MediaType in Storage daemon
-#}
-
-# Definition of 8mm tape storage device
-#Storage {
-# Name = "8mmDrive"
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-# Device = "Exabyte 8mm"
-# MediaType = "8mm"
-#}
-
-
-# Generic catalog service
-Catalog {
- Name = MyCatalog
- dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-# and to the console
-Messages {
- Name = Standard
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
- MailOnError = @job_email@ = all
- operator = @job_email@ = mount
- console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
-#
- append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
- Name = NoEmail
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- console = all, !skipped, !terminate
-#
-# WARNING! the following will create a file that you must cycle from
-# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
-#
- append = "@working_dir@/log" = all, !skipped
-}
-
-
-# Default pool definition
-Pool {
- Name = Default
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
- Accept Any Volume = yes # write on any volume in the pool
-# Label Format = "TEST-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}:${NumVols}"
-}
+++ /dev/null
-#!/bin/sh
-#
-# Create two blank tapes
-#
-@changer_path@ -f @autochanger@ unload
-@changer_path@ -f @autochanger@ load 1
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
-@changer_path@ -f @autochanger@ unload
-@changer_path@ -f @autochanger@ load 2
-mt -f @tape_drive@ rewind
-mt -f @tape_drive@ weof
-@changer_path@ -f @autochanger@ unload
+++ /dev/null
-#!/bin/sh
-#
-# This is the configuration script for regression testing
-#
-
-CFLAGS="-g -O2 -Wall" \
- ./configure \
- --sbindir=$1/bin \
- --sysconfdir=$1/bin \
- --with-pid-dir=$1/working \
- --with-subsys-dir=$1/working \
- --enable-smartalloc \
- --disable-readline \
- --with-working-dir=$1/working \
- --with-dump-email=$2 \
- --with-job-email=$2 \
- $3 \
- --with-baseport=8101 \
- $4
-
-exit 0
+++ /dev/null
-#!/bin/sh
-#
-# Script to setup running Bacula regression tests
-#
-cwd=`pwd`
-if [ $# != 4 ] ; then
- echo "Incorrect number of arguments. Got $#. Need:"
- echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
- echo " "
- exit 1
-fi
-if [ ! -d $1 ] ; then
- echo "Arg 1 must be a Bacula release directory."
- echo " "
- exit 1
-fi
-rm -rf build bin
-# Copy new source
-echo "Copying source from $1"
-cp -rp $1 build
-cp scripts/regress-config build
-cd build
-rm -f Makefile config.cache
-# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
-make
-make install
-cp src/tools/testls ../bin
-
-cd ..
-bin/bacula stop
-cd bin
-./create_bacula_database
-./drop_bacula_tables
-./make_bacula_tables
-./grant_bacula_privileges
-cd ..
-# Start and stop Bacula to ensure conf files are OK
-bin/bacula start
-bin/bacula stop
-#
-# Save Bacula default conf files for later use
-#
-cp -f bin/*.conf scripts
+++ /dev/null
-#
-# Default Bacula Director Configuration file
-#
-# The only thing that MUST be changed is to add one or more
-# file or directory names in the Include directive of the
-# FileSet resource.
-#
-# For Bacula release 1.33
-#
-# You might also want to change the default email address
-# from root to your address. See the "mail" and "operator"
-# directives in the Messages resource.
-#
-
-Director { # define myself
- Name = @hostname@-dir
- DIRport = 8101 # where we listen for UA connections
- QueryFile = "@scriptdir@/query.sql"
- WorkingDirectory = "@working_dir@"
- PidDirectory = "@piddir@"
- SubSysDirectory = "@subsysdir@"
- Maximum Concurrent Jobs = 4
- Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
- Messages = Daemon
-}
-
-#
-# Define the main nightly save backup job
-# By default, this job will back up to disk in /tmp
-Job {
- Name = "NightlySave"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
- Maximum Concurrent Jobs = 4
- SpoolData=yes
-}
-
-Job {
- Name = "MonsterSave"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File1
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
- Name = "VerifyVolume"
- Type = Verify
- Level = VolumeToCatalog
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-Job {
- Name = "SparseTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="SparseSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
- Name = "CompressedTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="CompressedSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Maximum Concurrent Jobs = 4
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-Job {
- Name = "SparseCompressedTest"
- Type = Backup
- Client=@hostname@-fd
- FileSet="SparseCompressedSet"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-# Backup the catalog database (after the nightly save)
-Job {
- Name = "BackupCatalog"
- Type = Backup
- Client=@hostname@-fd
- FileSet="Catalog"
-# Schedule = "WeeklyCycleAfterBackup"
- Storage = File
- Messages = Standard
- Pool = Default
- # This creates an ASCII copy of the catalog
- RunBeforeJob = "@sbindir@/make_catalog_backup -u bacula"
- # This deletes the copy of the catalog
- RunAfterJob = "@sbindir@/delete_catalog_backup"
- Write Bootstrap = "@working_dir@/BackupCatalog.bsr"
-}
-
-# Standard Restore template, to be changed by Console program
-Job {
- Name = "RestoreFiles"
- Type = Restore
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
- Name = "Full Set"
- Include = signature=MD5 {
- </tmp/file-list
- }
-}
-
-FileSet {
- Name = "SparseSet"
- Include = signature=MD5 sparse=yes {
- </tmp/file-list
- }
-}
-
-FileSet {
- Name = "CompressedSet"
- Include = signature=MD5 compression=GZIP {
- </tmp/file-list
- }
-}
-
-FileSet {
- Name = "SparseCompressedSet"
- Include = signature=MD5 compression=GZIP {
- </tmp/file-list
- }
-}
-
-
-
-#
-# When to do the backups, full backup on first sunday of the month,
-# differential (i.e. incremental since full) every other sunday,
-# and incremental backups other days
-Schedule {
- Name = "WeeklyCycle"
- Run = Full 1st sun at 1:05
- Run = Differential 2nd-5th sun at 1:05
- Run = Incremental mon-sat at 1:05
-}
-
-# This schedule does the catalog. It starts after the WeeklyCycle
-Schedule {
- Name = "WeeklyCycleAfterBackup"
- Run = Full sun-sat at 1:10
-}
-
-# This is the backup of the catalog
-FileSet {
- Name = "Catalog"
- Include = signature=MD5 {
- /home/kern/bacula/regress/bin/working/bacula.sql
- }
-}
-
-# Client (File Services) to backup
-Client {
- Name = @hostname@-fd
- Address = @hostname@
- FDPort = 8102
- Catalog = MyCatalog
- Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
- File Retention = 30d # 30 days
- Job Retention = 180d # six months
- AutoPrune = yes # Prune expired Jobs/Files
- Maximum Concurrent Jobs = 4
-}
-
-# Definiton of file storage device
-Storage {
- Name = File
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage
- Media Type = File
- Maximum Concurrent Jobs = 4
-}
-
-Storage {
- Name = File1
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage1
- Media Type = File1
- Maximum Concurrent Jobs = 4
-}
-
-
-# Definition of DLT tape storage device
-#Storage {
-# Name = DLTDrive
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
-# Device = "HP DLT 80" # must be same as Device in Storage daemon
-# Media Type = DLT8000 # must be same as MediaType in Storage daemon
-#}
-
-# Definition of DDS tape storage device
-#Storage {
-# Name = SDT-10000
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9" # password for Storage daemon
-# Device = SDT-10000 # must be same as Device in Storage daemon
-# Media Type = DDS-4 # must be same as MediaType in Storage daemon
-#}
-
-# Definition of 8mm tape storage device
-#Storage {
-# Name = "8mmDrive"
-# Address = @hostname@ # N.B. Use a fully qualified name here
-# SDPort = 8103
-# Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-# Device = "Exabyte 8mm"
-# MediaType = "8mm"
-#}
-
-
-# Generic catalog service
-Catalog {
- Name = MyCatalog
- dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-# and to the console
-Messages {
- Name = Standard
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
- MailOnError = @job_email@ = all
- operator = @job_email@ = mount
- console = all, !skipped, !terminate, !restored
-#
-# WARNING! the following will create a file that you must cycle from
-# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
-#
- append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
- Name = NoEmail
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- console = all, !skipped, !terminate
-#
-# WARNING! the following will create a file that you must cycle from
-# time to time as it will grow indefinitely. However, it will
-# also keep all your messages if the scroll off the console.
-#
- append = "@working_dir@/log" = all, !skipped
-}
-
-#
-# Message delivery for daemon messages (no job).
-Messages {
- Name = Daemon
- mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
- mail = @job_email@ = all, !skipped
- console = all, !skipped, !saved
- append = "@working_dir@/log" = all, !skipped
-}
-
-# Default pool definition
-Pool {
- Name = Default
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
- Accept Any Volume = yes # write on any volume in the pool
-}
+++ /dev/null
-#
-# Default Bacula File Daemon Configuration file
-#
-# For Bacula release 1.33
-#
-# There is not much to change here except perhaps the
-# File daemon Name to
-#
-
-#
-# List Directors who are permitted to contact this File daemon
-#
-Director {
- Name = @hostname@-dir
- Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"
-}
-
-#
-# "Global" File daemon configuration specifications
-#
-FileDaemon { # this is me
- Name = @hostname@-fd
- FDport = 8102 # where we listen for the director
- WorkingDirectory = "@working_dir@"
- Pid Directory = "@piddir@"
- SubSys Directory = "@subsysdir@"
-}
-
-# Send all messages except skipped files back to Director
-Messages {
- Name = Standard
- director = @hostname@-dir = all, !terminate
-}
+++ /dev/null
-#
-# Default Bacula Storage Daemon Configuration file
-#
-# For Bacula release 1.33
-#
-# You may need to change the name of your tape drive
-# on the "Archive Device" directive in the Device
-# resource. If you change the Name and/or the
-# "Media Type" in the Device resource, please ensure
-# that dird.conf has corresponding changes.
-#
-
-Storage { # definition of myself
- Name = @hostname@-sd
- SDPort = 8103 # Director's port
- WorkingDirectory = "@working_dir@"
- Pid Directory = "@piddir@"
- Subsys Directory = "@subsysdir@"
-}
-
-#
-# List Directors who are permitted to contact Storage daemon
-#
-Director {
- Name = @hostname@-dir
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
-}
-
-#
-# Devices supported by this Storage daemon
-# To connect, the Director's bacula-dir.conf must have the
-# same Name and MediaType.
-#
-
-Device {
- Name = FileStorage
- Media Type = File
- Archive Device = @tmpdir@
- LabelMedia = yes; # lets Bacula label unlabelled media
- Random Access = Yes;
- AutomaticMount = yes; # when device opened, read it
- RemovableMedia = no;
- AlwaysOpen = no;
-# Maximum File Size = 10KB
-}
-
-Device {
- Name = FileStorage1
- Media Type = File1
- Archive Device = @tmpdir@
- LabelMedia = yes; # lets Bacula label unlabelled media
- Random Access = Yes;
- AutomaticMount = yes; # when device opened, read it
- RemovableMedia = no;
- AlwaysOpen = no;
-}
-
-
-#Device {
-# Name = "HP DLT 80"
-# Media Type = DLT8000
-# Archive Device = /dev/nst0
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = yes;
-# RemovableMedia = yes;
-#}
-
-#Device {
-# Name = SDT-7000 #
-# Media Type = DDS-2
-# Archive Device = /dev/nst0
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = yes;
-# RemovableMedia = yes;
-#}
-
-#Device {
-# Name = Floppy
-# Media Type = Floppy
-# Archive Device = /mnt/floppy
-# RemovableMedia = yes;
-# Random Access = Yes;
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = no;
-#}
-
-#
-# A very old Exabyte with no end of media detection
-#
-#Device {
-# Name = "Exabyte 8mm"
-# Media Type = "8mm"
-# Archive Device = /dev/nst0
-# Hardware end of medium = No;
-# AutomaticMount = yes; # when device opened, read it
-# AlwaysOpen = Yes;
-# RemovableMedia = yes;
-#}
-
-#
-# Send all messages to the Director,
-# mount messages also are sent to the email address
-#
-Messages {
- Name = Standard
- director = @hostname@-dir = all, !terminate
-}
+++ /dev/null
-#
-# Bacula User Agent (or Console) Configuration File
-#
-
-Director {
- Name = @hostname@-dir
- DIRport = 8101
- address = @hostname@
- Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3"
-}
+++ /dev/null
-#
-# TestA Bacula Director Configuration file
-#
-# For Bacula release 1.30 (12 April 2003) -- redhat 7.3
-#
-
-Director { # define myself
- Name = @hostname@-dir
- DIRport = 8101 # where we listen for UA connections
- QueryFile = "@scriptdir@/query.sql"
- WorkingDirectory = "@working_dir@"
- PidDirectory = "@piddir@"
- SubSysDirectory = "@subsysdir@"
- Maximum Concurrent Jobs = 1
- Password = "pNvX1WiXnwv2C/F7E52LGvw6rKjbbPvu2kyuPa9pVaL3" # Console password
- Messages = Standard
-}
-
-
-Job {
- Name = "MultiVol"
- Type = Backup
- Client=@hostname@-fd
- Level = Full
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Write Bootstrap = "@working_dir@/SmallVols.bsr"
- Pool = SmallVols
- SpoolData = yes
-}
-
-
-Job {
- Name = "VerifyVolume"
- Type = Verify
- Level = VolumeToCatalog
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Write Bootstrap = "@working_dir@/NightlySave.bsr"
-}
-
-
-
-# Standard Restore template, to be changed by Console program
-Job {
- Name = "RestoreFiles"
- Type = Restore
- Client=@hostname@-fd
- FileSet="Full Set"
- Storage = File
- Messages = Standard
- Pool = Default
- Where = /tmp/bacula-restores
-}
-
-
-# List of files to be backed up
-FileSet {
- Name = "Full Set"
- Include = signature=SHA1 {
- </tmp/file-list
- }
-}
-
-
-# Client (File Services) to backup
-Client {
- Name = @hostname@-fd
- Address = @hostname@
- FDPort = 8102
- Catalog = MyCatalog
- Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc" # password for FileDaemon
- File Retention = 30d # 30 days
- Job Retention = 180d # six months
- AutoPrune = yes # Prune expired Jobs/Files
-}
-
-# Definiton of file storage device
-Storage {
- Name = File
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage
- Media Type = File
-}
-
-Storage {
- Name = File1
- Address = @hostname@ # N.B. Use a fully qualified name here
- SDPort = 8103
- Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
- Device = FileStorage1
- Media Type = File1
-}
-
-
-# Generic catalog service
-Catalog {
- Name = MyCatalog
- dbname = bacula; user = bacula; password = ""
-}
-
-# Reasonable message delivery -- send most everything to email address
-# and to the console
-Messages {
- Name = Standard
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
- MailOnError = @job_email@ = all, !terminate
- operator = @job_email@ = mount
- console = all, !skipped, !terminate
-
- append = "@working_dir@/log" = all, !skipped
-}
-
-Messages {
- Name = NoEmail
- mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula Regression\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
- console = all, !skipped, !terminate, !restored
- append = "@working_dir@/log" = all, !skipped
-}
-
-
-# Default pool definition
-Pool {
- Name = Default
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
- Accept Any Volume = yes # write on any volume in the pool
-}
-
-Pool {
- Name = SmallVols
- Pool Type = Backup
- Recycle = yes # Bacula can automatically recycle Volumes
- AutoPrune = yes # Prune expired volumes
- Volume Retention = 365d # one year
- Accept Any Volume = yes # write on any volume in the pool
- Maximum Volumes = 10
- MaximumVolumeBytes = 10M
- LabelFormat = Small
-}
+++ /dev/null
-#!/bin/sh
-./all-non-root-tape-tests
+++ /dev/null
-#!/bin/sh
-#
-# Test the fill command in btape
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-
-echo " "
-echo " "
-echo " === Starting btape fill test ==="
-echo " === Starting btape fill test ===" >>working/log
-echo " "
-
-bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
-fill
-s
-
-quit
-END_OF_DATA
-
-
-grep "^The last block on the tape matches\. Test succeeded\." tmp/log1.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " !!!!! btape fill test failed!!! !!!!! "
- echo " !!!!! btape fill test failed!!! !!!!! " >>test.out
- echo " "
-else
- echo " ===== btape fill test OK ===== "
- echo " ===== btape fill test OK ===== " >>test.out
-# scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-#
-# Test the fill command in btape
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-
-echo "${cwd}/build" >/tmp/file-list
-
-cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
-sed "s%# MaximumVolumeSize% MaximumVolumeSize%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-
-echo " "
-echo " "
-echo " === Starting btape fill test ==="
-echo " === Starting btape fill test ===" >>working/log
-echo " "
-exit
-bin/btape -c bin/bacula-sd.conf DDS-4 <<END_OF_DATA 2>&1 >tmp/log1.out
-fill
-s
-
-quit
-END_OF_DATA
-
-
-grep "^The last block on the tape matches\. Test succeeded\." tmp/log1.out 2>&1 >/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " !!!!! btape fill test failed!!! !!!!! "
- echo " !!!!! btape fill test failed!!! !!!!! " >>test.out
- echo " "
-else
- echo " ===== btape fill test OK ===== "
- echo " ===== btape fill test OK ===== " >>test.out
-# scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-# then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
- echo " "
- echo "You must be root to run this test."
- echo " ===== !!!! dev-test-root not run !!!! ===== "
- echo " ===== !!!! dev-test-root not run !!!! ===== " >>test.out
- echo " "
- exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/dev" >/tmp/file-list
-
-echo " "
-echo " "
-echo " === Starting dev-test-root test ==="
-echo " "
-echo " === Note, this test can fail for trivial ==="
-echo " === reasons on non-Linux systems. ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File volume=TestVolume001
-run job=NightlySave yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test dev >${cwd}/tmp/restored
-cd ${cwd}/tmp
-#
-# Use sed to cut out parts that *always* change
-#
-cat >sed.scr <<END_OF_DATA
-s%.*dev$%dev%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ptmx%dev/ptmx%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/ttyp1%dev/ttyp1%
-s%.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9] dev/null%dev/null%
-END_OF_DATA
-
-# strip file system change messages then sed and sort
-grep -v "Skip: File system change prohibited." original >1
-sed -f sed.scr 1 | sort >original
-#
-mv -f restored 1
-sed -f sed.scr 1 | sort >restored
-rm -f sed.scr
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " ===== !!!! dev-test-root failed !!!! ===== "
- echo " ===== !!!! dev-test-root failed !!!! ===== " >>test.out
- echo " "
-else
- echo " ===== dev-test-root OK ===== "
- echo " ===== dev-test-root OK ===== " >>test.out
- scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-# then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
- echo " "
- echo "You must be root to run this test."
- echo " ===== !!!! etc-test-root not run !!!! ===== "
- echo " ===== !!!! etc-test-root not run !!!! ===== " >>test.out
- echo " "
- exit 1
-fi
-echo " "
-echo " "
-echo " === Starting /etc save/restore test ==="
-echo " "
-echo " "
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/etc" >/tmp/file-list
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select
-unmark *
-mark *
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
-sort <${cwd}/tmp/1 >${cwd}/tmp/original
-sort <${cwd}/tmp/2 >${cwd}/tmp/restored
-rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/null
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " ===== !!!! etc-test-root failed !!!! ===== "
- echo " ===== !!!! etc-test-root failed !!!! ===== " >>test.out
- echo " "
-else
- echo " ===== etc-test-root OK ===== "
- echo " ===== etc-test-root OK ===== " >>test.out
- scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the /lib directory
-# then restore it.
-#
-cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
-cd bin
-./drop_bacula_tables >/dev/null 2>&1
-./make_bacula_tables >/dev/null 2>&1
-./grant_bacula_privileges 2>&1 >/dev/null
-cd ..
-
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "/lib" >/tmp/file-list
-echo " "
-echo " "
-echo " === Starting lib-tape-root test ==="
-echo " "
-echo " "
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 Volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " ===== lib-tape-root failed!!! ===== "
- echo " ===== lib-tape-root failed!!! ===== " >>test.out
- echo " "
-else
- echo " ===== lib-tape-root OK ===== "
- echo " ===== lib-tape-root OK ===== " >>test.out
- scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the Bacula build directory
-# then restore it.
-#
-MUID=`/usr/bin/id -u`
-if [ $MUID != 0 ] ; then
- echo " "
- echo "You must be root to run this test."
- echo " ===== !!!! lib-test-root not run !!!! ===== "
- echo " ===== !!!! lib-test-root not run !!!! ===== " >>test.out
- echo " "
- exit 1
-fi
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
-echo "/lib" >/tmp/file-list
-
-echo " "
-echo " "
-echo " === Starting /lib save/restore test ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=File
-TestVolume001
-run job=NightlySave
-yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select
-unmark *
-mark *
-done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-lib-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " ===== !!!! lib-test-root failed !!!! ===== "
- echo " ===== !!!! lib-test-root failed !!!! ===== " >>test.out
- echo " "
-else
- echo " ===== lib-test-root OK ===== "
- echo " ===== lib-test-root OK ===== " >>test.out
- scripts/cleanup
-fi
+++ /dev/null
-#!/bin/sh
-echo " " >test.out
-rm -f bin/working/*
+++ /dev/null
-#!/bin/sh
-#
-# Run a simple backup of the /usr directory
-# then restore it.
-#
-cwd=`pwd`
-scripts/copy-tape-confs
-scripts/cleanup-tape
-echo "/usr" >/tmp/file-list
-
-echo " "
-echo " "
-echo " === Starting usr-tape-root test ==="
-echo " "
-echo " "
-
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
-messages
-@output tmp/log1.out
-label storage=DDS-4 Volume=TestVolume001 slot=0
-run job=NightlySave yes
-wait
-messages
-@#
-@# now do a restore
-@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all done
-yes
-wait
-messages
-@output
-quit
-END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
-cd /
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/original
-cd ${cwd}/tmp/bacula-restores
-${cwd}/bin/testls -e ${cwd}/scripts/exclude-usr-test lib >${cwd}/tmp/restored
-cd ${cwd}/tmp
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% original >1
-sort <1 >original
-#
-sed s%.*lib/kbd/consolefonts$%lib/kbd/consolefonts% restored >1
-sort <1 >restored
-rm -f 1
-#
-cd ${cwd}
-diff tmp/original tmp/restored 2>&1 1>/dev/nul
-if [ $? != 0 ] ; then
- echo " "
- echo " "
- echo " ===== !!!! usr-tape-root failed !!!! ===== "
- echo " ===== !!!! usr-tape-root failed !!!! ===== " >>test.out
- echo " "
-else
- echo " ===== usr-tape-root OK ===== "
- echo " ===== usr-tape-root OK ===== " >>test.out
- scripts/cleanup
-fi