mirror of
https://github.com/gophernicus/gophernicus.git
synced 2025-02-02 15:08:00 -05:00
Build fixes for NetBSD and TCP wrappers (libwrap)
This commit is contained in:
parent
60b391e65e
commit
f56ae187ef
6
Makefile
6
Makefile
@ -54,14 +54,14 @@ IPCRM = /usr/bin/ipcrm
|
||||
all:
|
||||
@case `uname` in \
|
||||
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDEST)" $(BINARY); ;; \
|
||||
Haiku) $(MAKE) EXTRA_LDFLAGS="-lnetwork" $(BINARY); ;; \
|
||||
Haiku) $(MAKE) EXTRA_LIBS="-lnetwork" $(BINARY); ;; \
|
||||
*) if [ -f "/usr/include/tcpd.h" ]; then $(MAKE) withwrap; else $(MAKE) $(BINARY); fi; ;; \
|
||||
esac
|
||||
|
||||
generic: $(BINARY)
|
||||
|
||||
withwrap:
|
||||
$(MAKE) EXTRA_CFLAGS="-DHAVE_LIBWRAP" EXTRA_LDFLAGS="-lwrap" $(BINARY)
|
||||
$(MAKE) EXTRA_CFLAGS="-DHAVE_LIBWRAP" EXTRA_LIBS="-lwrap" $(BINARY)
|
||||
|
||||
|
||||
#
|
||||
@ -87,7 +87,7 @@ ChangeLog:
|
||||
$(NAME).c: $(NAME).h $(HEADERS)
|
||||
|
||||
$(BINARY): $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJECTS) -o $@
|
||||
$(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJECTS) $(EXTRA_LIBS) -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DVERSION="\"$(VERSION)\"" -DCODENAME="\"$(CODENAME)\"" -DDEFAULT_ROOT="\"$(ROOT)\"" $< -o $@
|
||||
|
@ -26,6 +26,15 @@
|
||||
#include "gophernicus.h"
|
||||
|
||||
|
||||
/*
|
||||
* Libwrap needs these defined
|
||||
*/
|
||||
#ifdef HAVE_LIBWRAP
|
||||
int allow_severity = LOG_DEBUG;
|
||||
int deny_severity = LOG_ERR;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Print gopher menu line
|
||||
*/
|
||||
|
@ -113,7 +113,6 @@
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_SENDFILE
|
||||
#include <sys/sendfile.h>
|
||||
|
14
platform.c
14
platform.c
@ -35,11 +35,13 @@ void platform(state *st)
|
||||
#if defined(_AIX) || defined(__linux) || defined(__APPLE__)
|
||||
FILE *fp;
|
||||
#endif
|
||||
#if defined(__linux) || defined(__APPLE__)
|
||||
char buf[BUFSIZE];
|
||||
#endif
|
||||
#ifdef __linux
|
||||
struct stat file;
|
||||
#endif
|
||||
struct utsname name;
|
||||
char buf[BUFSIZE];
|
||||
char sysname[64];
|
||||
char release[64];
|
||||
char machine[64];
|
||||
@ -154,13 +156,11 @@ void platform(state *st)
|
||||
|
||||
/* No DMI? Get possible hypervisor name */
|
||||
if (!*st->server_description && (fp = fopen("/sys/hypervisor/type" , "r"))) {
|
||||
if (fgets(buf, sizeof(buf), fp) == NULL) strclear(buf);
|
||||
if (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
chomp(buf);
|
||||
if (*buf) snprintf(st->server_description, sizeof(st->server_description), "%s virtual machine", buf);
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
chomp(buf);
|
||||
ucfirst(buf);
|
||||
|
||||
if (*buf) snprintf(st->server_description, sizeof(st->server_description), "%s virtual machine", buf);
|
||||
}
|
||||
|
||||
/* Identify Gentoo */
|
||||
|
10
string.c
10
string.c
@ -26,16 +26,6 @@
|
||||
#include "gophernicus.h"
|
||||
|
||||
|
||||
/*
|
||||
* Make a string's first character uppercase
|
||||
*/
|
||||
void ucfirst(char *str)
|
||||
{
|
||||
if (str == NULL || !*str) return;
|
||||
*str = toupper(*str);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Repeat a character num times and zero-terminate
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user