]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/cvs.pm
avoid tempfile warning
[ikiwiki.git] / IkiWiki / Plugin / cvs.pm
index c891174e07300611677f5a54fb36847a646fc1f6..f6db8bc98b0f723feb40363eb7978ffc469c9ab9 100644 (file)
@@ -1,6 +1,34 @@
-#!/usr/pkg/bin/perl
+#!/usr/bin/perl
 package IkiWiki::Plugin::cvs;
 
+# Copyright (c) 2009 Amitai Schlair
+# All rights reserved.
+#
+# This code is derived from software contributed to ikiwiki
+# by Amitai Schlair.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY IKIWIKI AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
 use warnings;
 use strict;
 use IkiWiki;
@@ -294,11 +322,12 @@ sub rcs_recentchanges($) {
        eval q{use File::ReadBackwards};
        error($@) if $@;
 
-       my (undef, $tmpfile) = tempfile(OPEN=>0);
+       my ($tmphandle, $tmpfile) = tempfile();
        system("env TZ=UTC cvsps -q --cvs-direct -z 30 -x >$tmpfile");
        if ($? == -1) {
                error "couldn't run cvsps: $!\n";
-       } elsif (($? >> 8) != 0) {
+       }
+       elsif (($? >> 8) != 0) {
                error "cvsps exited " . ($? >> 8) . ": $!\n";
        }