Permalink
Browse files

Added byte order tag to cache file name (see #72862)

  • Loading branch information...
1 parent 7f252ea commit 89f27a6d47df79b8bdb93781ba3247d7a5123165 @jwbargsten committed Feb 16, 2013
Showing with 7 additions and 4 deletions.
  1. +7 −4 ProcessTable.pm
View
@@ -5,6 +5,7 @@ use 5.006;
use strict;
use Carp;
use Fcntl;
+use Config;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
require Exporter;
@@ -47,7 +48,8 @@ use Proc::ProcessTable::Process;
use File::Find;
my %TTYDEVS;
-our $TTYDEVSFILE = "/tmp/TTYDEVS"; # Where we store the TTYDEVS hash
+
+our $TTYDEVSFILE = "/tmp/TTYDEVS_" . $Config{byteorder}; # Where we store the TTYDEVS hash
sub new
{
@@ -193,8 +195,10 @@ is overriden to be false.
cache_ttys -- causes the constructor to look for and use a file that
caches a mapping of tty names to device numbers, and to create the
-file if it doesn't exist (this file is /tmp/TTYDEVS by default). This
-feature requires the Storable module.
+file if it doesn't exist. This feature requires the Storable module.
+By default, the cache file name consists of a prefix F</tmp/TTYDEVS_> and a
+byte order tag. The file name can be accessed (and changed) via
+C<$Proc::ProcessTable::TTYDEVSFILE>.
=item fields
@@ -245,7 +249,6 @@ are supported directly by internal perl functions.
}
}
-
=head1 CAVEATS
Please see the file README in the distribution for a list of supported

0 comments on commit 89f27a6

Please sign in to comment.