summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-02-22 13:08:21 +0100
committerantirez <antirez@gmail.com>2017-02-22 13:08:21 +0100
commit95883313b5a405916fabed34c3af290d6072c817 (patch)
treee8059914f45616a3803fe1987e6a864fa7d29e1e
parent2b36706a48759ac6ed991ab1f8257de122425a75 (diff)
downloadredis-95883313b5a405916fabed34c3af290d6072c817.tar.gz
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.
-rw-r--r--src/atomicvar.h2
-rw-r--r--tests/integration/aof.tcl6
-rw-r--r--tests/integration/rdb.tcl4
-rw-r--r--tests/unit/aofrw.tcl2
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"
}