]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
importd: some minor tweaks (#39008)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Sep 2025 06:48:14 +0000 (15:48 +0900)
committerGitHub <noreply@github.com>
Fri, 19 Sep 2025 06:48:14 +0000 (15:48 +0900)
1  2 
src/import/export-tar.c
src/import/import-common.c
src/import/import-common.h
src/import/import-tar.c

Simple merge
index c55dad179f900870813321fb04f518e5d14a4f07,2de01953a396f2975bd2702d95cef5c267898cf0..b6e47fee4d60c695a86c7a9029b5e26073056170
@@@ -33,14 -32,14 +33,16 @@@ int import_fork_tar_x(const char *path
          if (pipe2(pipefd, O_CLOEXEC) < 0)
                  return log_error_errno(errno, "Failed to create pipe for tar: %m");
  
+         (void) fcntl(pipefd[0], F_SETPIPE_SZ, IMPORT_BUFFER_SIZE);
          use_selinux = mac_selinux_use();
  
 -        r = safe_fork_full("(tar)",
 -                           (int[]) { pipefd[0], -EBADF, STDERR_FILENO },
 -                           NULL, 0,
 -                           FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, &pid);
 +        r = pidref_safe_fork_full(
 +                        "(tar)",
 +                        (int[]) { pipefd[0], -EBADF, STDERR_FILENO },
 +                        NULL, 0,
 +                        FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG,
 +                        &pid);
          if (r < 0)
                  return r;
          if (r == 0) {
@@@ -104,14 -103,14 +106,16 @@@ int import_fork_tar_c(const char *path
          if (pipe2(pipefd, O_CLOEXEC) < 0)
                  return log_error_errno(errno, "Failed to create pipe for tar: %m");
  
+         (void) fcntl(pipefd[0], F_SETPIPE_SZ, IMPORT_BUFFER_SIZE);
          use_selinux = mac_selinux_use();
  
 -        r = safe_fork_full("(tar)",
 -                           (int[]) { -EBADF, pipefd[1], STDERR_FILENO },
 -                           NULL, 0,
 -                           FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, &pid);
 +        r = pidref_safe_fork_full(
 +                        "(tar)",
 +                        (int[]) { -EBADF, pipefd[1], STDERR_FILENO },
 +                        NULL, 0,
 +                        FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG,
 +                        &pid);
          if (r < 0)
                  return r;
          if (r == 0) {
Simple merge
Simple merge