diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-08-03 17:13:56 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-08-03 17:13:56 +0200 |
commit | 91c47e6fdf9aff728761177aff731442efc5ab29 (patch) | |
tree | 042a0181f419e6d69e67dfcae1ce612757a6e210 /scripts/mytop.sh | |
parent | 82ce2a2503a95e8bdc76c351a87e98c93445a433 (diff) | |
download | mariadb-git-91c47e6fdf9aff728761177aff731442efc5ab29.tar.gz |
MDEV-6485 Hard-coded paths in the source cannot be opt-out
when looking for my.cnf files: if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR)
is specified (for rpms it always is), use that instead of hardcoded /etc path.
Diffstat (limited to 'scripts/mytop.sh')
-rw-r--r-- | scripts/mytop.sh | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/scripts/mytop.sh b/scripts/mytop.sh index 480805e90b1..1cf1c5313b4 100644 --- a/scripts/mytop.sh +++ b/scripts/mytop.sh @@ -70,7 +70,6 @@ sub GetShowStatus(); sub cmd_s; sub cmd_S; sub cmd_q; -sub FindProg($); ## Default Config Values @@ -1366,9 +1365,9 @@ sub GetInnoDBStatus() { if (not $config{pager}) { - if (not $config{pager} = FindProg('less')) + if (not $config{pager} = my_which('less')) { - $config{pager} = FindProg('more'); + $config{pager} = my_which('more'); } } @@ -1467,9 +1466,9 @@ sub GetShowVariables() { if (not $config{pager}) { - if (not $config{pager} = FindProg('less')) + if (not $config{pager} = my_which('less')) { - $config{pager} = FindProg('more'); + $config{pager} = my_which('more'); } } @@ -1825,25 +1824,6 @@ sub Execute($) return $sth; } -sub FindProg($) -{ - my $prog = shift; - my $found = undef; - my @search_dirs = ("/bin", "/usr/bin", "/usr/sbin", - "/usr/local/bin", "/usr/local/sbin"); - - for (@search_dirs) - { - my $loc = "$_/$prog"; - if (-e $loc) - { - $found = $loc; - last; - } - } - return $found; -} - #### #### my_which is used, because we can't assume that every system has the #### which -command. my_which can take only one argument at a time. |