]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Silence a Perl warning output by stop.pl
authorMichał Kępień <michal@isc.org>
Tue, 12 Mar 2019 07:42:48 +0000 (08:42 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 12 Mar 2019 07:43:13 +0000 (08:43 +0100)
On Unix systems, the CYGWIN environment variable is not set at all when
BIND system tests are run.  If a named instance crashes on shutdown or
otherwise fails to clean up its pidfile and the CYGWIN environment
variable is not set, stop.pl will print an uninitialized value warning
on standard error.  Prevent this by using defined().

(cherry picked from commit 91e5a99b9b10e9cb6904f39a26c47e9dfd39693a)

bin/tests/system/stop.pl

index 5a4f16b5d3b6f36e7d07c88cd24c80020ab3b7ab..1166315332605a6fa5ca3104d8318320d93ba159 100644 (file)
@@ -251,7 +251,7 @@ sub clean_pid_file {
        if (send_signal(0, $pid) == 0) {
                # XXX: on windows this is likely to result in a
                # false positive, so don't bother reporting the error.
-               if ($ENV{'CYGWIN'} eq "") {
+               if (!defined($ENV{'CYGWIN'})) {
                        print "I:$test:$server crashed on shutdown\n";
                        $errors = 1;
                }