Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.
(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Define the prototypes for et_list_lock() and et_list_unlock() in
com_err.h. This promotes better error checking and avoids warnings
when compiling the library and programs that call these functions.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Some applications repeatedly re-exec themselves, and if they use the
com_err library, they can leak a file descriptor for each re-exec.
Fix this by setting the close-on-exec flag on the debug file
descriptor. In addition, if the COMERR_DEBUG environment variable
isn't set, don't open the file handle at all.
Addresses-Red-Hat-Bugzilla: #464689
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads. Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.
This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library. Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.
The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces. I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock(). Threaded
applications shouldn't be using these interfaces in any case.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Address the theoretical problem of two threads trying to format a
different unknown error code by using TLS.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
On 64-bit systems (or anything with sizeof(long) > sizeof(int)), we
sometimes get error codes passed to error_message which have been cast
from an (int) to an (unsigned int). This almost always happens if
you're using libgssapi_krb5, which returns an error code which is less
than 0 but is returned in an (unsigned int).
For example, -1765328377L gets cast to 2529638919, which is
0x96c73a07, not 0xffffffff96c73a07, so error_message() fails to find a
matching error table.
When error_message() then calls the error_table_name() function to get a
name to use in the "unknown code" message, it gets a correct value back.
This happens because error_table_name() drops most of the higher bits of
the parameter it's passed before doing anything else with it (& 077777777f,
or & 0xffffff). If we did the same thing in error_message(), we wouldn't
have a problem there, either.
Problem reported and fixed by: Nalin Dahyabhai
Addresses-Sourceforge-Bug: #1809658
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix the info-dir line so that the menu name does not contain a .info
prefix. First of all, it's ugly, secondly, it causes the install-info
command to fail to remove the com_err info file from the
/usr/share/info/dir file when the comerr-dev package is removed and
purged.
Addresses Debian Bug: #401711
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the environment variable COMERR_DEBUG is set to 1, print out debugging
messages as error tables are added and removed from the com_err library.
If the COMERR_DEBUG_FILE environment variable is set (and the process is
not setuid) the debugging messages may be redirected to a file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add a dependency to make sure that the subdirectories are created before
creating all of the object files.
Addresses Sourceforge Bug: #1261553
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
via add_error_table() and the other dynamic methods from
the ones allocated via initialize_xxx_error_table() so
that we won't fail even for error tables created using old
versions of compile_et. Thanks to Nalin Dahyabhai for
this suggested patch.
initialize_xxx_error_table(), to prevent segfaults if an
old library calls initialize_xxx_error_table, and another
library/application calls add_error_table() on the same
error table, and then calls remove_error_table().
(Addresses Sourcefroge Bug #1150146)
original versions of the files, so as to avoid rebuilding files when not
necessary. Also fixes a potential SMP/Parallel build problem when one
make process runs compile_et to generate the .h file, and a partially
generated .c file is compiled by another make process. (Addresses
Sourceforge Bug: #1157933)
correctly.
Update Makefile dependencies.
Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.
Remove sync from e2fsck's "make all" target.
Declare comerr-dev as replacing << e2fslibs-dev 1.33-2, to avoid
errors when upgrading to the new versions of comerr-dev and
e2fslibs-dev
Declare init_error_table as taking a long for the second argument.