The texi2html utility from the texi2html ceased being developed
upstream in 2011, and upstream has declared it superseded by the
makeinfo utility from the texinfo package.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Mostly by adding static and removing excess extern qualifiers. Also
convert a few remaining non-ANSI function declarations to ANSI.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Run sparse against source files when building e2fsprogs with 'make C=1'. If
instead C=2, it configures basic ext2 types for bitwise checking with sparse,
which can help find the (many many) spots where conversion errors are
(possibly) happening.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If secure_getenv() use it in preference to __secure_getenv().
Starting with (e)glibc version 2.17, secure_getenv() exists, while
__secure_getenv() only works with shared library links (where it is a
weak symbol), but not for static links with /lib/libc.a
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix up the com_err.texinfo file so it will produce a valid printed
output, by cleaning up some errors in the texinfo file, and updating
texinfo.tex to be consistent with the version in the doc subdirectory.
Also add rules so we can generate pdf and ps files from
com_err.texinfo and libext2fs.texinfo.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Change the include path in the Cflags field so that #include
<lib/foo.h> and <foo.h> will work. We had originally used a C flags
which allowed <foo.h> to work, but many applications (especially those
not using pkg-config) had been using the <lob/foo.h> formulation which
didn't require an explicit -I{$includedir} option to the C compiler.
If those applications then converted over to pkg-config, and the
e2fsprogs libraries were installed with a prefix other than /usr, so
that the header files were in some directory such as
/usr/local/include, a program that used #include <lib/foo.h> would
fail to compile.
So change the pkg-config files to include both -I{$includedir} and
-I{$includir}/lib.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
compile_et puts #include <et/com_err.h> in
generated header files so pkg-config --cflags
com_err should provide the path to the directory
containing et/.
This function allows programs to pass in a pointer to the gettext
function so that error table strings will can be internationalized.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn. It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.
So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.
In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If $(LINK_INSTALL_FLAGS) is -f instead of -sf, the Makefile's install
rule would not work correctly while installing com_err.h
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
After debian bug #192277, debian/rules started making a symlink
to com_err.h in /usr/include. Now I have Fedora bug #550889
for the same issue, and perhaps it's time to make this link
by default, rather than fixing it up in packaging steps?
[ Changed by tytso to remove the explicit -s option; this will default
to creating a hard link by default, which slightly faster. If
people want to use symlinks for all links during the install
process, they can use configure option --enable-symlink-install.
The reason for this change is that some file systems, like AFS,
don't support symlinks, and AFS users complain when they can't build
or install into AFS. So I don't want to use symlinks
unconditionally without a way of switching things back and forth,
and it's easier if we just make all links made during the install
process to be hard links or sym links. ]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This fixes a long-standing botch in the com_err library, and solves a
regression test problem for libss that gets tickled by source code
management systems (like Perforce) that don't preserve CRLF line
endings with fidelity.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Unfortunately, texi2html gratuitously changed its behavior of where
its output html files are placed when the -split_chapter is in effect.
(First it was in a subdirectory; then it was in the current directory;
now it's back to putting the output html files in a subdirectory
again.)
Support either way of doing things since the texi2html team seems to
be indecisive...
Addresses-Debian-Bug: #552934
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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.