Useless use of cat in Daemon.pm
Bug #995896 reported by
Baron Schwartz
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Low
|
Daniel Nichter |
Bug Description
This code shouldn't use `cat`:
sub check_PID_file {
my ( $self, $file ) = @_;
my $PID_file = $self ? $self->{PID_file} : $file;
PTDEBUG && _d('Checking PID file', $PID_file);
if ( $PID_file && -f $PID_file ) {
my $pid;
eval { chomp($pid = `cat $PID_file`); };
die "Cannot cat $PID_file: $OS_ERROR" if $EVAL_ERROR;
That won't work on Windows, and there's no real reason for it.
Related branches
lp:~percona-toolkit-dev/percona-toolkit/fix-995896-cat-in-daemon
- Daniel Nichter: Approve
-
Diff: 884 lines (+359/-53) (has conflicts)26 files modifiedbin/pt-archiver (+14/-2)
bin/pt-config-diff (+14/-2)
bin/pt-deadlock-logger (+14/-2)
bin/pt-duplicate-key-checker (+14/-2)
bin/pt-fifo-split (+14/-2)
bin/pt-find (+14/-2)
bin/pt-fk-error-logger (+14/-2)
bin/pt-heartbeat (+14/-2)
bin/pt-kill (+14/-2)
bin/pt-log-player (+14/-2)
bin/pt-online-schema-change (+14/-2)
bin/pt-query-advisor (+14/-2)
bin/pt-query-digest (+14/-2)
bin/pt-show-grants (+14/-2)
bin/pt-slave-delay (+14/-2)
bin/pt-slave-find (+14/-2)
bin/pt-slave-restart (+14/-2)
bin/pt-table-checksum (+14/-2)
bin/pt-table-sync (+14/-2)
bin/pt-table-usage (+14/-2)
bin/pt-trend (+14/-2)
bin/pt-upgrade (+14/-2)
bin/pt-variable-advisor (+14/-2)
bin/pt-visual-explain (+14/-2)
lib/Daemon.pm (+16/-2)
t/lib/Daemon.t (+7/-3)
tags: | added: useless-work windows |
Changed in percona-toolkit: | |
status: | New → Confirmed |
summary: |
- Useless use of cat + Useless use of cat in Daemon.pm |
Changed in percona-toolkit: | |
assignee: | nobody → Daniel Nichter (daniel-nichter) |
importance: | Undecided → Low |
milestone: | none → 2.1.6 |
tags: | removed: useless-work |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-778