]> git.saurik.com Git - redis.git/commitdiff
Merged Solaris patches provided by Alan Harder
authorantirez <antirez@gmail.com>
Mon, 26 Oct 2009 15:25:07 +0000 (16:25 +0100)
committerantirez <antirez@gmail.com>
Mon, 26 Oct 2009 15:25:07 +0000 (16:25 +0100)
Makefile
pqsort.c
redis.c

index 4fe428c41fdb8f45a8b81eee92f79d8ff7d3d07a..43d273237e50493cced8687c62bb7626e60650c1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,15 @@
 # Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
 # 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
index f532d6de495c0616d617b89519e06dc82efe74b7..da60fd1ffe686c7ae7e0a543628c9ce1cd983076 100644 (file)
--- a/pqsort.c
+++ b/pqsort.c
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-#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 <sys/types.h>
 
 #include <assert.h>
diff --git a/redis.c b/redis.c
index 0115fd27cc170a23da1811727b300e76cecfa1d0..eb0a1730d72d4b8cb6314c77336b3f32c1766667 100644 (file)
--- 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;
     }