Drop libcompat to simplify build deps and really fix #11
The original idea with libcompat was to keep as few objects as possible for linking with libsyslog. That in turn to prevent a user of libsyslog from suddenly also getting strong binding to symbols like strlcpy() from libsyslog, rather than their C library of choice. However, this caused strlcpy.c to be built as both .o and .lo files, which in turn caused really bizarre build problems due to bad DAG dependency. This patch drops libcompat and instead marks all replacement APIs as weak symbols, which a C library can override. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@ -31,6 +31,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#ifndef HAVE_PIDFILE
|
||||
|
||||
#define _GNU_SOURCE /* Needed with GLIBC to get asprintf() */
|
||||
#include <sys/stat.h> /* utimensat() */
|
||||
#include <sys/time.h> /* utimensat() on *BSD */
|
||||
@ -54,7 +57,7 @@ const char *__pidfile_path = RUNSTATEDIR;
|
||||
const char *__pidfile_name = NULL;
|
||||
|
||||
int
|
||||
pidfile(const char *basename)
|
||||
__pidfile(const char *basename)
|
||||
{
|
||||
int save_errno;
|
||||
int atexit_already;
|
||||
@ -136,3 +139,6 @@ pidfile_cleanup(void)
|
||||
pidfile_path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
weak_alias(__pidfile, pidfile);
|
||||
#endif /* HAVE_PIDFILE */
|
||||
|
Reference in New Issue
Block a user