]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Add error handling to stat stub
authorMartin Schwenke <mschwenke@ddn.com>
Sat, 28 Feb 2026 00:49:09 +0000 (11:49 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 9 Jul 2026 16:02:43 +0000 (16:02 +0000)
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/UNIT/eventscripts/stubs/stat

index e8bd081aff5b39ac0c8dfafa2d3261071f4f25cb..bc854cf60a51bc02a8a121cc60cbd5d3b4d8c785 100755 (executable)
@@ -39,8 +39,12 @@ fake_inode()
 }
 
 if [ -n "$format" ]; then
+       rc=0
        for f; do
                if [ ! -e "$f" ]; then
+                       echo "stat: cannot statx '${f}': " \
+                               "No such file or directory"
+                       rc=1
                        continue
                fi
                case "$f" in
@@ -61,7 +65,7 @@ if [ -n "$format" ]; then
                esac
        done
 
-       exit
+       exit $rc
 fi
 
 usage