dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] standard_file: Reverse return code logic for remote exists


From: Simon Marchi
Subject: [PATCH 2/2] standard_file: Reverse return code logic for remote exists
Date: Fri, 22 Jan 2016 15:22:30 -0500

The local "exists" case:

  return [file exists $file]

returns 1 when the file exists, 0 otherwise.  The remote case does the
opposite, because it returns the process return code directly, where 0
is true/success/exists and non-zero is false/fail/does not exist.  This
patch fixes the remote case by reversing the logic.

ChangeLog:

        * lib/remote.exp (standard_file): Reverse return logic for
        remote exists case.
---
 lib/remote.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/remote.exp b/lib/remote.exp
index 688680b..359cf31 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -766,7 +766,7 @@ proc standard_file { dest op args } {
        switch $op {
            exists {
                set status [remote_exec $dest "test -f $file"]
-               return [lindex $status 0]
+               return [expr [lindex $status 0] == 0]
            }
            delete {
                set file ""
-- 
2.5.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]