]>
Commit | Line | Data |
---|---|---|
344783c8 AM |
1 | --- local/fixproc.orig 2005-05-18 09:57:16.000000000 -0400 |
2 | +++ local/fixproc 2005-05-18 11:00:38.000000000 -0400 | |
3 | @@ -129,6 +129,9 @@ | |
4 | # | |
5 | # Timothy Kong 3/1995 | |
6 | ||
7 | +require File::Temp; | |
8 | +use File::Temp(); | |
9 | + | |
10 | $database_file = '/local/etc/fixproc.conf'; | |
11 | ||
12 | $debug = 0; # specify debug level using -dN | |
13 | @@ -196,7 +199,6 @@ | |
14 | printf (stderr "create_sh_script\n") if ($debug > 0); | |
15 | ||
16 | $! = $fixproc_error; | |
17 | - open (file, ">"."$file") || die "$0: cannot open $file\n"; | |
18 | while ( $shell_lines[$i] ne $shell_end_marker ) | |
19 | { | |
20 | printf (file "%s", $shell_lines[$i]); | |
21 | @@ -231,13 +233,13 @@ | |
22 | { | |
23 | # it must be "shell", so execute the shell script defined in database | |
24 | ||
25 | - local ($tmpfile) = "/tmp/fix_$$"; | |
26 | + local ($tmpfile) = new File::Temp(TEMPLATE => 'fix_XXXXX', | |
27 | + DIR => '/tmp'); | |
28 | ||
29 | &create_sh_script ($fix{$proc}, $tmpfile); | |
30 | ||
31 | # return code is number divided by 256 | |
32 | $error_code = (system "$tmpfile") / 256; | |
33 | - system "rm $tmpfile"; | |
34 | return ($fix_failed_error) if ($error_code != 0); | |
35 | # sleep needed here? | |
36 | return &do_exist ($proc); | |
37 | @@ -262,13 +264,13 @@ | |
38 | # if not "exist", then it must be "shell", so execute the shell script | |
39 | # defined in database | |
40 | ||
41 | - local ($tmpfile) = "/tmp/check_$$"; | |
42 | + local ($tmpfile) = new File::Temp(TEMPLATE => 'check_XXXXXX', | |
43 | + DIR => '/tmp'); | |
44 | ||
45 | &create_sh_script ($check{$proc}, $tmpfile); | |
46 | ||
47 | # return code is number divided by 256 | |
48 | $error_code = (system "$tmpfile") / 256; | |
49 | - system "rm $tmpfile"; | |
50 | return ($check_failed_error) if ($error_code != 0); | |
51 | ||
52 | # check passed, continue |