package run_program; use diagnostics; use strict; use log; 1; sub run($@) { rooted('', @_) } sub rooted { my ($root, $name, @args) = @_; my $str = ref $name ? $name->[0] : $name; log::l("running: $str @args" . ($root ? " with root $root" : "")); return 1 if $root && $<; $root ? $root .= '/' : ($root = ''); if (my $pid = fork) { waitpid $pid, 0; return $? == 0; } { my ($stdout, $stdoutm, $stderr, $stderrm); ($stdoutm, $stdout, @args) = @args if $args[0] =~ /^>>?$/; ($stderrm, $stderr, @args) = @args if $args[0] =~ /^2>>?$/; open STDIN, "/dev/null" or die "can't open /dev/null as stdin"; if ($stderr) { $stderrm =~ s/2//; open STDERR, "$stderrm $root$stderr" or die "run_program can't output in $root$stderr (mode `$stderrm')"; } else { open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "run_program can't log, give me access to /tmp/exec.log"; } if ($stdout) { open STDOUT, "$stdoutm $root$stdout" or die "run_program can't output in $root$stdout (mode `$stdoutm')"; } else { open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "run_program can't log, give me access to /tmp/exec.log"; } $root and chroot $root; chdir "/"; if (ref $name) { unless (exec { $name->[0] } $name->[1], @args) { log::l("exec of $name->[0] failed: $!"); c::_exit(1); } } else { unless (exec $name, @args) { log::l("exec of $name failed: $!"); c::_exit(1); } } } } mga7'>distro/mga7 Hardware List for the Light Hardware Detection ToolThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/lst
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2014-01-27 21:30:52 +0159
committerThomas Backlund <tmb@mageia.org>2014-01-27 21:30:52 +0159
commit4968cdbbb398f0515e385e30662156a0d87b348d (patch)
tree1200d57d7439a4aa18d9006676b5fdcf3f9186e5 /lst
parentf07ce6882db7c0b7cd5d4d1df6f45828c36e6777 (diff)
downloadldetect-lst-4968cdbbb398f0515e385e30662156a0d87b348d.tar
ldetect-lst-4968cdbbb398f0515e385e30662156a0d87b348d.tar.gz
ldetect-lst-4968cdbbb398f0515e385e30662156a0d87b348d.tar.bz2
ldetect-lst-4968cdbbb398f0515e385e30662156a0d87b348d.tar.xz
ldetect-lst-4968cdbbb398f0515e385e30662156a0d87b348d.zip
add 2 missing intel gpu ids (0x041e and 0x0f32)
Diffstat (limited to 'lst')
-rw-r--r--lst/pcitable2
1 files changed, 2 insertions, 0 deletions
diff --git a/lst/pcitable b/lst/pcitable
index 5a90281d..a658fe46 100644
--- a/lst/pcitable
+++ b/lst/pcitable