Skip to content

Commit

Permalink
Merge remote-tracking branch 'forge/2.3.x' into 2.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed May 15, 2012
2 parents d71821d + f95ed5b commit 2011a5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Expand Up @@ -77,7 +77,7 @@ sub _getDisksFromProc {
$disk->{FIRMWARE} = $2;

# that's the controller itself, not a disk
next if $disk->{MODEL} =~ 'raid';
next if $disk->{MODEL} =~ /(raid|RAID)/;

$disk->{MANUFACTURER} = getCanonicalManufacturer(
$disk->{MODEL}
Expand Down
13 changes: 10 additions & 3 deletions lib/FusionInventory/Agent/Tools.pm
Expand Up @@ -45,8 +45,6 @@ our @EXPORT = qw(
delay
);

my $nowhere = $OSNAME eq 'MSWin32' ? 'nul' : '/dev/null';

# this trigger some errors on Perl 5.12/Win32:
# Anonymous function called in forbidden scalar context
if ($OSNAME ne 'MSWin32') {
Expand Down Expand Up @@ -233,7 +231,16 @@ sub getFileHandle {
last SWITCH;
}
if ($params{command}) {
if (!open $handle, '-|', $params{command} . " 2>$nowhere") {
if ($OSNAME eq 'MSWin32') {
FusionInventory::Agent::Tools::Win32->require;
(undef, $handle) = FusionInventory::Agent::Tools::Win32::runCommand(
command => $params{command},
no_stderr => 1
);
if (!$handle) {
return;
}
} elsif (!open $handle, '-|', $params{command} . " 2>/dev/null") {
$params{logger}->error(
"Can't run command $params{command}: $ERRNO"
) if $params{logger};
Expand Down
4 changes: 4 additions & 0 deletions lib/FusionInventory/Agent/Tools/Win32.pm
Expand Up @@ -268,7 +268,11 @@ Returns a command in a Win32 Process
=item command the command to run
<<<<<<< HEAD
=item timeout a time in second, default is 3600*2
=======
=item timeout a time in second, default is 3600*2
>>>>>>> forge/2.3.x
=item no_stderr ignore STDERR output, default is false
=back
Expand Down

0 comments on commit 2011a5e

Please sign in to comment.