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.
This commit is contained in:
antirez 2017-02-22 13:08:21 +01:00
parent 2b36706a48
commit 95883313b5
4 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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!"
}

View File

@ -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"
}