From: antirez Date: Mon, 26 Oct 2009 15:25:07 +0000 (+0100) Subject: Merged Solaris patches provided by Alan Harder X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/325d1eb4a86b59eaa8c867b2bb0a7a827d98aaf0?hp=e3870fab57b8073de1ebc04bbd300c6ab45c1c34 Merged Solaris patches provided by Alan Harder --- diff --git a/Makefile b/Makefile index 4fe428c4..43d27323 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,15 @@ # Copyright (C) 2009 Salvatore Sanfilippo # This file is released under the BSD license, see the COPYING file +uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +ifeq ($(uname_S),SunOS) + CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -D__EXTENSIONS__ -D_XPG6 + CCLINK?= -ldl -lnsl -lsocket +else + CFLAGS?= -std=c99 -pedantic -O2 -Wall -W +endif +CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) DEBUG?= -g -rdynamic -ggdb -CFLAGS?= -std=c99 -O2 -pedantic -Wall -W -CCOPT= $(CFLAGS) $(ARCH) OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o @@ -45,7 +51,7 @@ redis-cli: $(CLIOBJ) $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ) .c.o: - $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $< + $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $< clean: rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o diff --git a/pqsort.c b/pqsort.c index f532d6de..da60fd1f 100644 --- a/pqsort.c +++ b/pqsort.c @@ -37,15 +37,6 @@ * SUCH DAMAGE. */ -#include -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; -#else -__RCSID("$NetBSD: qsort.c,v 1.19 2009/01/30 23:38:44 lukem Exp $"); -#endif -#endif /* LIBC_SCCS and not lint */ - #include #include diff --git a/redis.c b/redis.c index 0115fd27..eb0a1730 100644 --- a/redis.c +++ b/redis.c @@ -2329,7 +2329,7 @@ static int rdbSave(char *filename) { /* Use RENAME to make sure the DB file is changed atomically only * if the generate DB file is ok. */ if (rename(tmpfile,filename) == -1) { - redisLog(REDIS_WARNING,"Error moving temp DB file on the final destionation: %s", strerror(errno)); + redisLog(REDIS_WARNING,"Error moving temp DB file on the final destination: %s", strerror(errno)); unlink(tmpfile); return REDIS_ERR; }