svn commit: r317306 - head/tools/regression/geom_gpt

Ngie Cooper ngie at FreeBSD.org
Sat Apr 22 22:40:41 UTC 2017


Author: ngie
Date: Sat Apr 22 22:40:39 2017
New Revision: 317306
URL: https://svnweb.freebsd.org/changeset/base/317306

Log:
  gctl_test.t: minor tweaks
  
  - Declare $count with the `my` scope operator to permit `use strict`.
  - Add `use strict`.
  - Use `use warnings` instead of using `-w` in the shebang.
  - Don't unlink $cmd when done (prevents unnecessary rebuilding).
  - Improve the error message when running with insufficient permissions, e.g.,
    non-root.
  
  MFC after:	5 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/tools/regression/geom_gpt/gctl_test.t

Modified: head/tools/regression/geom_gpt/gctl_test.t
==============================================================================
--- head/tools/regression/geom_gpt/gctl_test.t	Sat Apr 22 22:37:44 2017	(r317305)
+++ head/tools/regression/geom_gpt/gctl_test.t	Sat Apr 22 22:40:39 2017	(r317306)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 #
 # Copyright (c) 2005, 2006 Marcel Moolenaar
 # All rights reserved.
@@ -26,6 +26,9 @@
 #
 # $FreeBSD$
 
+use strict;
+use warnings;
+
 my $disk = "/tmp/disk-$$";
 my $mntpt = "/tmp/mount-$$";
 
@@ -138,12 +141,12 @@ my $out = "/tmp/$cmd.out";
 
 # Make sure we have permission to use gctl...
 if (`$cmd` =~ "^FAIL Permission denied") {
-    print "1..0 # SKIP not enough permission\n";
+    print "1..0 # SKIP insufficient permissions\n";
     unlink $cmd;
     exit 0;
 }
 
-$count = keys (%steps);
+my $count = keys (%steps);
 print "1..$count\n";
 
 my $nr = 1;
@@ -200,6 +203,4 @@ foreach my $key (sort keys %steps) {
     }
     $nr += 1;
 }
-
-unlink $cmd;
 exit 0;


More information about the svn-src-all mailing list