Merge a number of fixes for CentOS 7

Webdis needed a number of small fixes to build and run on CentOS 7
(released in 2014). Initially reported in PR #231 as a missing -std=
compiler flag, there turned out to be more tweaks needed to cleanly
build and run.
master
Nicolas Favre-Felix 2 years ago
commit 5eece37333
No known key found for this signature in database
GPG Key ID: C04E7AA8B6F73372

@ -5,7 +5,7 @@ B64_OBJS?=src/b64/cencode.o
FORMAT_OBJS?=src/formats/json.o src/formats/raw.o src/formats/common.o src/formats/custom-type.o
HTTP_PARSER_OBJS?=src/http-parser/http_parser.o
CFLAGS ?= -Wall -Wextra -Isrc -Isrc/jansson/src -Isrc/http-parser -MD
CFLAGS ?= -std=c99 -Wall -Wextra -Isrc -Isrc/jansson/src -Isrc/http-parser -MD -D_POSIX_C_SOURCE=200809L -Wno-pragmas
LDFLAGS ?= -levent -pthread
# Pass preprocessor macros to the compile invocation

@ -5,6 +5,7 @@
#include "client.h"
#include <string.h>
#include <strings.h>
#include <evhttp.h>
#include <netinet/in.h>
#include <arpa/inet.h>

@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <errno.h>
#include <hiredis/hiredis.h>

@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#include <ctype.h>

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <arpa/inet.h>
#include <unistd.h>

@ -5,6 +5,7 @@
#include "client.h"
#include <string.h>
#include <strings.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

@ -5,6 +5,7 @@
#include "client.h"
#include <string.h>
#include <strings.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>

@ -2,7 +2,9 @@
#define __HIREDIS_FMACRO_H
#define _XOPEN_SOURCE 600
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
#endif
#if defined(__APPLE__) && defined(__MACH__)
/* Enable TCP_KEEPALIVE */

@ -5,6 +5,7 @@
#include "slog.h"
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

@ -200,7 +200,7 @@ server_daemonize(struct server *s, const char *pidfile) {
/* write pidfile */
if(pidfile) {
int pid_fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, 0600);
int pid_fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if(pid_fd > 0) {
char pid_buffer[(CHAR_BIT * sizeof(int) / 3) + 3]; /* max length for int */
int pid_sz = snprintf(pid_buffer, sizeof(pid_buffer), "%d\n", (int)getpid());

Loading…
Cancel
Save