Skip to content

Commit 3f44abc

Browse files
committed
apt-file: Defer loading POSIX module
Signed-off-by: Niels Thykier <[email protected]>
1 parent a362085 commit 3f44abc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apt-file

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use constant {
3535
CONFIG_SEARCH_PARSER_DESC_HEADER => 'apt-file::Parser::Check-For-Description-Header',
3636
};
3737

38-
use POSIX qw(_exit);
3938
use Getopt::Long qw/:config gnu_getopt no_ignore_case/;
4039
use File::Basename;
4140
use AptPkg::Config '$_config';
@@ -252,6 +251,9 @@ sub open_data_pipeline {
252251
close($to_cat)
253252
or error("close write end of xargs pipe: $!");
254253
debug(1, 'Input closed, reaping completed children');
254+
# We load POSIX here as it take ~0.010s and the children will
255+
# be vastly longer, so we can "hide" the load time here.
256+
require POSIX;
255257
do {
256258
$dead_pid = waitpid(-1, 0);
257259
if ($dead_pid > 0) {

0 commit comments

Comments
 (0)