summaryrefslogtreecommitdiff
path: root/libexec/makewhatis
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-05-31 18:38:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-05-31 18:38:31 +0000
commitd67cfb9a17a76fe8f9d0d7cbe1c7b5bfbadff565 (patch)
treef07be36c28c28e071485b43ae32a065888d1251d /libexec/makewhatis
parentcaf4c09758727bd63c7f50f01ac2c6708e172c4d (diff)
Request from Theo:
- name tmp file after makewhatis, make it easier to track in case of trouble. - remove tmp file always, two minutes to regenerate top
Diffstat (limited to 'libexec/makewhatis')
-rw-r--r--libexec/makewhatis/makewhatis.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/makewhatis/makewhatis.pl b/libexec/makewhatis/makewhatis.pl
index 5caf2d4db3e..d0f3c0dacad 100644
--- a/libexec/makewhatis/makewhatis.pl
+++ b/libexec/makewhatis/makewhatis.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# ex:ts=8 sw=4:
-# $OpenBSD: makewhatis.pl,v 1.10 2000/05/17 12:09:00 espie Exp $
+# $OpenBSD: makewhatis.pl,v 1.11 2000/05/31 18:38:30 espie Exp $
#
# Copyright (c) 2000 Marc Espie.
#
@@ -50,7 +50,7 @@ sub write_uniques
local $_;
my ($out, $tempname);
- ($out, $tempname) = tempfile() or die "$0: Can't open temporary file";
+ ($out, $tempname) = tempfile('/tmp/makewhatis.XXXXXXXXXX') or die "$0: Can't open temporary file";
my @sorted = sort @$list;
my $last;
@@ -69,7 +69,8 @@ sub write_uniques
chmod 0444, $f;
chown 0, (getgrnam 'bin')[2], $f;
} else {
- print STDERR "$0: Can't create $f ($!), temporary result is in $tempname\n";
+ print STDERR "$0: Can't create $f ($!)\n";
+ unlink($tempname);
exit 1;
}
}