From c46a0e319987ca6bcd8f93b1658f45a21d5c7c12 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Mon, 8 Apr 2013 15:16:53 -0600 Subject: [PATCH] Fix init_config_file() when config file doesn't exist yet. --- bin/pt-agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pt-agent b/bin/pt-agent index 9afb0f69..974efe37 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -6242,8 +6242,8 @@ sub init_config_file { my $config_file = get_config_file(); eval { - die "$config_file is not writable\n" - unless -w $config_file; + die "$config_file exists but is not writable\n" + if -f $config_file && !-w $config_file; open my $fh, '>', $config_file or die "Error opening $config_file: $OS_ERROR"; print { $fh } "api-key=$api_key\n"