diff --git a/Makefile b/Makefile index 2170699..3674b60 100644 --- a/Makefile +++ b/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 $@ diff --git a/gophernicus.c b/gophernicus.c index 4601fe3..ed146ac 100644 --- a/gophernicus.c +++ b/gophernicus.c @@ -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 */ diff --git a/gophernicus.h b/gophernicus.h index d987b09..23c5386 100644 --- a/gophernicus.h +++ b/gophernicus.h @@ -113,7 +113,6 @@ #include #include #include -#include #ifdef HAVE_SENDFILE #include diff --git a/platform.c b/platform.c index f4e21b7..89c9537 100644 --- a/platform.c +++ b/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 */ diff --git a/string.c b/string.c index 238950d..ad7edfc 100644 --- a/string.c +++ b/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 */ diff --git a/version b/version index aaabdeb..7394b25 100755 --- a/version +++ b/version @@ -4,7 +4,7 @@ ## Generate Gophernicus version/build number ## -DEFAULT=99 +DEFAULT="PE" if which git >/dev/null && test -d .git; then git log | grep -c "^commit"