]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Avoid shellcheck warning SC2038 (find without -print0)
authorMartin Schwenke <martin@meltin.net>
Tue, 12 Jul 2016 03:27:08 +0000 (13:27 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Jul 2016 00:24:27 +0000 (02:24 +0200)
SC2038: Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.

The suggested options aren't POSIX-compliant.  This is more portable.

Base filenames can't have whitespace so rework to avoid problems with
whitespace in directory name.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index 3b9d1dbbfa2fbf974d5d3954d383d5db0ec1ed62..c9fe207167bc6927266e547e0470fddb59af63a9 100755 (executable)
@@ -1290,7 +1290,9 @@ update_tickles ()
        rm -f "$_my_connections" "$_my_tickles"
 
        # Remove stale files from killed scripts
-       find "$tickledir" -type f -mmin +10 | xargs -r rm
+       # Files can't have spaces in name, more portable than -print0/-0
+       # shellcheck disable=SC2038
+       (cd "$tickledir" && find . -type f -mmin +10 | xargs -r rm)
 }
 
 ########################################################