From 95883313b5a405916fabed34c3af290d6072c817 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 22 Feb 2017 13:08:21 +0100 Subject: [PATCH] Solaris fixes about tail usage and atomic vars. Testing with Solaris C compiler (SunOS 5.11 11.2 sun4v sparc sun4v) there were issues compiling due to atomicvar.h and running the tests also failed because of "tail" usage not conform with Solaris tail implementation. This commit fixes both the issues. --- src/atomicvar.h | 2 +- tests/integration/aof.tcl | 6 +++--- tests/integration/rdb.tcl | 4 ++-- tests/unit/aofrw.tcl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/atomicvar.h b/src/atomicvar.h index 4aa8fa173..c522db3e9 100644 --- a/src/atomicvar.h +++ b/src/atomicvar.h @@ -51,7 +51,7 @@ #ifndef __ATOMIC_VAR_H #define __ATOMIC_VAR_H -#if defined(__ATOMIC_RELAXED) && (!defined(__clang__) || !defined(__APPLE__) || __apple_build_version__ > 4210057) +#if defined(__ATOMIC_RELAXED) && !defined(__sun) && (!defined(__clang__) || !defined(__APPLE__) || __apple_build_version__ > 4210057) /* Implementation using __atomic macros. */ #define atomicIncr(var,count,mutex) __atomic_add_fetch(&var,(count),__ATOMIC_RELAXED) diff --git a/tests/integration/aof.tcl b/tests/integration/aof.tcl index 832f996e1..e397faeeb 100644 --- a/tests/integration/aof.tcl +++ b/tests/integration/aof.tcl @@ -88,7 +88,7 @@ tags {"aof"} { set pattern "*Bad file format reading the append only file*" set retry 10 while {$retry} { - set result [exec tail -n1 < [dict get $srv stdout]] + set result [exec tail -1 < [dict get $srv stdout]] if {[string match $pattern $result]} { break } @@ -113,7 +113,7 @@ tags {"aof"} { set pattern "*Unexpected end of file reading the append only file*" set retry 10 while {$retry} { - set result [exec tail -n1 < [dict get $srv stdout]] + set result [exec tail -1 < [dict get $srv stdout]] if {[string match $pattern $result]} { break } @@ -137,7 +137,7 @@ tags {"aof"} { set pattern "*Unexpected end of file reading the append only file*" set retry 10 while {$retry} { - set result [exec tail -n1 < [dict get $srv stdout]] + set result [exec tail -1 < [dict get $srv stdout]] if {[string match $pattern $result]} { break } diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl index 2ed47cc58..66aad4cc7 100644 --- a/tests/integration/rdb.tcl +++ b/tests/integration/rdb.tcl @@ -66,7 +66,7 @@ if {!$isroot} { test {Server should not start if RDB file can't be open} { wait_for_condition 50 100 { [string match {*Fatal error loading*} \ - [exec tail -n1 < [dict get $srv stdout]]] + [exec tail -1 < [dict get $srv stdout]]] } else { fail "Server started even if RDB was unreadable!" } @@ -90,7 +90,7 @@ start_server_and_kill_it [list "dir" $server_path] { test {Server should not start if RDB is corrupted} { wait_for_condition 50 100 { [string match {*CRC error*} \ - [exec tail -n10 < [dict get $srv stdout]]] + [exec tail -10 < [dict get $srv stdout]]] } else { fail "Server started even if RDB was corrupted!" } diff --git a/tests/unit/aofrw.tcl b/tests/unit/aofrw.tcl index c5430eedc..dff7588ff 100644 --- a/tests/unit/aofrw.tcl +++ b/tests/unit/aofrw.tcl @@ -73,7 +73,7 @@ start_server {tags {"aofrw"}} { r config set appendonly no r exec wait_for_condition 50 100 { - [string match {*Killing*AOF*child*} [exec tail -n5 < [srv 0 stdout]]] + [string match {*Killing*AOF*child*} [exec tail -5 < [srv 0 stdout]]] } else { fail "Can't find 'Killing AOF child' into recent logs" }