The subsequent mmap(2) call will fail if the directory does not exist
(or if the path is not a directory), so this check is not needed.
This removes the only user of the E_OSL_NOTDIR error code. We must
keep it in the errlist file though, because error codes must be
considered part of the API.
Andre Noll [Tue, 18 Apr 2017 20:07:54 +0000 (22:07 +0200)]
Remove sha1.h.
The file contains only the declaration of sha1_hash() and the
definition of HASH_SIZE This commit moves HASH_SIZE from sha1.h to
hash.h and moves the declaration of sha1_hash() to hash.h, the only
file which needs it.
Andre Noll [Tue, 18 Apr 2017 18:23:30 +0000 (20:23 +0200)]
Remove COMPAT_TABLE_VERSION.
The compatibility version concept was introduced eight years ago in
commit (62d228ec), and was never needed. In fact, COMPAT_TABLE_VERSION
has always been zero so far. This commit gets rid of it.
Given a library version and the on-disk table version, we can still
tell whether the table can be opened by comparing the MIN_TABLE_VERSION
and the CURRENT_TABLE_VERSION numbers of the library against the
value stored in the table (i.e., the CURRENT_TABLE_VERSION value of
the library that created the table).
Andre Noll [Mon, 15 Jun 2020 14:29:52 +0000 (16:29 +0200)]
Makefile: Also build osl.h by default.
Otherwise it gets built as root during make install and is thus owned
by root. This may cause problems, for example if the source resides
on an NFS mounted directory where root is not allowed to write.
Andre Noll [Sun, 17 May 2020 20:04:40 +0000 (22:04 +0200)]
build: Prefix CFLAGS and friends with OSL_.
It is best practice to leave the "official" CPPFLAGS, CFLAGS and
LDFLAGS variables alone and just add them at the end of the command
line options. This way the user may override any of our settings
by setting the corresponding option in the official variable. For
example, to deactivate warnings about unused variables or functions,
one may compile with
Andre Noll [Sat, 16 May 2020 11:23:03 +0000 (13:23 +0200)]
build: Create dependencies on the fly.
This is faster since we run the compiler only once. It is more robust,
too, because the build does not break if a random .h file is added to
the working directory. Using $(wildcard) is almost always a mistake..
Andre Noll [Mon, 3 Jun 2019 12:05:10 +0000 (14:05 +0200)]
Merge branch 'refs/heads/t/lopsub'
* refs/heads/t/lopsub:
Convert oslfsck to lopsub.
The merge conflicted twice for the Makefile because of commit ec08b17c7514 which touched the object list of oslfsck and added
-DVERSION to the CPPFLAGs. This was easy to fix, though.
Andre Noll [Wed, 19 Apr 2017 13:49:38 +0000 (15:49 +0200)]
build: Fix dependencies for oslfsck.
The autogenerated Makefile.deps does not work for the oslfsck
exectutable because we compile the object files for oslfsck without
-fPIC to generate more performant code, and name them e.g. util.fsck.o
instead of util.o.
Geting rid of this optimization not only fixes the dependencies but
also simplifies the Makefile and speeds up the build.
Andre Noll [Sun, 28 Aug 2016 21:04:06 +0000 (23:04 +0200)]
Convert oslfsck to lopsub.
The gengetopt project seems to be dead (last release was five years
ago), so we eventually need to switch to something else.
This commit migrates the option parser of oslfsck to the lopsub
library, which turned out to be rather simple. As a result, the osl
package no longer depends on gengetopt and help2man.
The change only affects the oslfsck executable. No changes to the
library proper.
Andre Noll [Thu, 21 Apr 2016 09:09:39 +0000 (11:09 +0200)]
Convert README and INSTALL to markdown.
The grutatxt project is dead, so we need to switch to something else
eventually. Fortunately, only little changes are required for the
switch to the markdown markup language as there are only two files in
the source tree which are formated with grutatxt. This patch converts
both files and adjusts the Makefile to run the markdown converter
instead of the grutatxt script.
Andre Noll [Wed, 13 Jan 2016 14:35:36 +0000 (15:35 +0100)]
web: Create man page with groff rather than man2html.
The man2html project is dead, as is the link on the osl web page. The
URL mentioned in the info of the man2html package for Ubuntu-14.04
still works but might not be the most up to date page on the planet
any more:
In any case, it's a funny read. Needless to say that the link to the
sunsite FTP server is also dead.
This commit makes osl independent of man2html, simply by running groff
-Thtml instead of man2html. This even simplifies the Makefile a bit.
The patch also removes the dead link on the osl main page. We don't
need a replacement reference to groff because groff should be installed
on all systems anyway.
Andre Noll [Wed, 13 Jan 2016 14:12:02 +0000 (15:12 +0100)]
web: Update Doxyfile.
This file was created long ago with doxygen version 1.5.4. The system
on which the public web pages are generated runs Ubuntu 14.04 which
ships doxygen-1.8.6. This doxygen version complains as follows:
Warning: Tag `DETAILS_AT_TOP' at line 162 of file web/Doxyfile has become obsolete.
To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
Warning: Tag `SHOW_DIRECTORIES' at line 424 of file web/Doxyfile has become obsolete.
To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
Warning: Tag `HTML_ALIGN_MEMBERS' at line 727 of file web/Doxyfile has become obsolete.
To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
This patch is the result of running doxygen -u web/Doxyfile. With the
updated file the above warnings go away, and the pages look identical.
Andre Noll [Mon, 26 Oct 2015 14:38:09 +0000 (15:38 +0100)]
web: Switch to UTF-8 encoding.
Probably doesn't matter at all since there isn't a single text file in
the repo which is not pure ASCII. But still, in 2016 iso-8859 should
not be used any more..
Andre Noll [Sat, 9 Aug 2014 13:21:50 +0000 (15:21 +0200)]
Add make target www.
The new target allows to update the web page with "make www", followed
by a suitable command to copy the "web" directory to the server. That's
as easy as it gets.
Andre Noll [Thu, 22 Jan 2015 12:58:20 +0000 (13:58 +0100)]
web: Remove SSI for last modification in footer.html.
The footer.html file is is only used for the doxygen pages. It contains
a server side include directive although SSI is not activated on the
people.tuebingen.mpg.de web server and probably will never be.
This commit gets rid of the SSI and also removes the end tags </td>
and </table> from footer.html as these elements are not open at this
point of the document. This was found by the w3c validator.
Removes also the link to the W2C validator. Nobody wants to see this,
and doxygen does not even create valid html anyway..
Andre Noll [Mon, 24 Aug 2015 15:34:28 +0000 (17:34 +0200)]
Explain the osl_strerror dance.
It's not completely obvious what is going on here and *why* we not
just go with a simple pointer array for the messages returned by
osl_strerror(). This commit explains why pointer arrays are bad
in DSOs.
Andre Noll [Mon, 24 Aug 2015 15:35:08 +0000 (17:35 +0200)]
Fix comment on SHA1 implementation.
The dependency on openssl was dropped six years ago in commit f0884471. This commit corrects the stale comment that still says we
use openssl's sha1 implementation.
Andre Noll [Sat, 13 Jun 2015 18:47:33 +0000 (20:47 +0200)]
osl_get_nth_row(): Always initialize result pointer.
We buy into Postel's prescription and try to be liberal in what we
accept, and conservative in what we send. This patch makes sure the
result pointer is set to NULL on failure, and documents this fact.
Andre Noll [Sun, 4 Jan 2015 00:34:26 +0000 (00:34 +0000)]
osl_update_object(): Honor OSL_DONT_FREE.
When osl_update_object() is called to replace an object of
an OSL_NO_STORAGE column, it frees the old object even if the
OSL_DONT_FREE flag is set for the column, which is wrong. This patch
changes the function to call free() only if OSL_DONT_FREE is unset.
Andre Noll [Sun, 4 Jan 2015 00:33:35 +0000 (00:33 +0000)]
Mention that OSL_RBTREE implies OSL_UNIQUE.
Also print a warning when a table is opened or created which contains
a column description with OSL_RBTREE set but OSL_UNIQUE unset. Future
versions of osl might reject such table descriptions. But in order
to not break existing applications, we can not make such a change
without a deprecation period. So a warning has to suffice for now.
Andre Noll [Mon, 11 Aug 2014 09:13:25 +0000 (11:13 +0200)]
Install relative links to the soname.
On make install, the library is installed to $(libdir)/$(realname)
(e.g. /usr/local/lib/libosl.so.0.1.2), and a link is created to
map $(linkername) to $(soname) (e.g. /usr/local/lib/libosl.so ->
/usr/local/lib/libosl.so.0).
This changes the ln command to create a relative link rather than an
absolute link. For example, /usr/local/lib/libosl.so now points to
libosl.so.0 without the leading directory. This shouldn't matter much
but it allows to move both files elsewhere without breaking the link.
Andre Noll [Tue, 14 Jan 2014 14:11:12 +0000 (15:11 +0100)]
Fix adu link.
After the upgrade of the servers at systemlinux.org last week, the web
service is no longer available through http://systemlinux.org. Adjust
the link to the adu page accordingly.
Andre Noll [Tue, 22 May 2012 15:55:10 +0000 (17:55 +0200)]
Allow to build a static version of libosl.
This adds the new target libosl.a which creates an archive that can
be statically linked into applications. Currently this works only on
ELF-based systems including Linux, FreeBSD and NetBSD, but fails on
MacOS. So it is not built automatically.
Unfortunately, creating libosl.a turned out to be trickier than
expected, because -fvisibility=hidden works only for dynamic libraries.
So we need a different method to hide non-static internal symbols
like make_message() which must not be global (external) because they
might clash with symbols used in the application.
objcopy(1) does the trick but we must provide a list of exceptional
symbols that should not be made local. This list is generated from
the osl.h header file.
Andre Noll [Wed, 25 Nov 2009 09:40:08 +0000 (10:40 +0100)]
Split install target.
As proposed by Sebastian Stark, this introduces the install-lib,
install-bin and install-man targets. The simple "make install" still
installs everything, but splitting the target allows people to install
for example only the library if they do not have all tools available
which are necessary to build the oslfsck binary or its man page.
Andre Noll [Fri, 20 Nov 2009 08:38:56 +0000 (09:38 +0100)]
Drop dependency on openssl.
This patch adds git's implementation of the sha1 hash algorithm. This
makes osl more self-contained as it allows to build osl without
openssl being installed.
It should also reduce the startup time of applications that link
against libosl.
Andre Noll [Mon, 2 Nov 2009 13:39:16 +0000 (14:39 +0100)]
Set CC to gcc by default.
On systems where cc != gcc, compilation likely fails because we are
using quite some gccisms in osl. So default to gcc but let the user
override the default by setting CC manually.
The straight-forward CC ?= gcc does not work with gnu make as make
assigns CC the default value "cc".
Thanks to Steffen Schmidt for pointing out this shortcoming.
Andre Noll [Mon, 3 Aug 2009 09:31:49 +0000 (11:31 +0200)]
README: Clarify red-black tree statements.
As noted by Sebastian Stark, the old text was a bit misleading. So
make it clear that no special linux files are necessary to compile
the library.
Also, the sentence on table locking was not quite true: There's the
dirty bit in each osl table which is some kind of locking. Correct that
statement as well.
Andre Noll [Sun, 2 Aug 2009 10:31:07 +0000 (12:31 +0200)]
Improve table versioning.
This patch changes the way table version numbers are stored on disk.
Two version numbers instead of only one are stored in the table header:
The version of the lib that created the table, and the lowest version
number of the lib that can read the table.
As the latter is currently 0, it has no effect so far, i.e. tables
created with previous versions of the library still work fine. However,
with this change future versions of the library can detect from the
on-disk versions and the library version numbers if table and library
are compatible.
Andre Noll [Sat, 11 Jul 2009 21:24:02 +0000 (23:24 +0200)]
fsck: Fix a serious bug in prune_mapped_column().
This function still contained a relict from the old database format that was changed in commit 6d7dce7f277fc8606fb8d5ed6360660c13a218af. This caused prune_mapped_column()
to write one byte too much to the data file of a mapped column for each removed row.
Running the buggy oslfsck on a table with mapped columns where rows have been deleted
likely results in data corruption to objects adjacent to the deleted objects.
Worst of all, since only the data files but not the index is affected, the corruption will not
immediately be noticed, which is probably why it took one year to find this bug. Kill it with
pleasure.