In the --fast-read mode send SIGTERM to decompressor once we have extracted
all files we have been asked for. This vastly improves performance of pkg_add(1), because usually it only extract +CONTENTS file in --fast-read mode, checks it and only then extracts full content of tarball in normal mode. Without this patch, it have had to decompress the tarball twice, effectively doubling consumed CPU time. MFC after: 1 week
This commit is contained in:
parent
86eedb4ef4
commit
301ca7cf84
@ -1332,6 +1332,9 @@ close_archive (void)
|
|||||||
might become clever enough to just stop working, once there is no more
|
might become clever enough to just stop working, once there is no more
|
||||||
work to do, we might have to revise this area in such time. */
|
work to do, we might have to revise this area in such time. */
|
||||||
|
|
||||||
|
if (fast_read_option && namelist_freed)
|
||||||
|
kill(child_pid, SIGTERM);
|
||||||
|
|
||||||
if (access_mode == ACCESS_READ
|
if (access_mode == ACCESS_READ
|
||||||
&& ! _isrmt (archive)
|
&& ! _isrmt (archive)
|
||||||
&& (S_ISFIFO (archive_stat.st_mode) || S_ISSOCK (archive_stat.st_mode)))
|
&& (S_ISFIFO (archive_stat.st_mode) || S_ISSOCK (archive_stat.st_mode)))
|
||||||
@ -1358,12 +1361,13 @@ close_archive (void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WIFSIGNALED (wait_status))
|
if (!fast_read_option || !namelist_freed)
|
||||||
ERROR ((0, 0, _("Child died with signal %d"),
|
if (WIFSIGNALED (wait_status))
|
||||||
WTERMSIG (wait_status)));
|
ERROR ((0, 0, _("Child died with signal %d"),
|
||||||
else if (WEXITSTATUS (wait_status) != 0)
|
WTERMSIG (wait_status)));
|
||||||
ERROR ((0, 0, _("Child returned status %d"),
|
else if (WEXITSTATUS (wait_status) != 0)
|
||||||
WEXITSTATUS (wait_status)));
|
ERROR ((0, 0, _("Child returned status %d"),
|
||||||
|
WEXITSTATUS (wait_status)));
|
||||||
}
|
}
|
||||||
#endif /* !MSDOS */
|
#endif /* !MSDOS */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user