Rewrite of "--remote", to use a temporary file for information exchange instead of a SysV IPC message queue, to correct the fault where "make check -j32" would fail due to every PV exit removing the message queue.

This commit is contained in:
Andrew Wood
2023-10-01 01:20:16 +01:00
parent 965cc52815
commit 0e1750835e
9 changed files with 252 additions and 141 deletions
+7
View File
@@ -142,6 +142,10 @@ struct pvstate_s {
volatile sig_atomic_t pv_sig_newsize; /* whether we need to get term size again */
volatile sig_atomic_t pv_sig_abort; /* whether we need to abort right now */
volatile sig_atomic_t reparse_display; /* whether to re-check format string */
#ifdef SA_SIGINFO
volatile sig_atomic_t pv_sig_rxusr2; /* whether SIGUSR2 was received */
volatile pid_t pv_sig_sender; /* PID of sending process for SIGUSR2 */
#endif
struct sigaction pv_sig_old_sigpipe;
struct sigaction pv_sig_old_sigttou;
struct sigaction pv_sig_old_sigtstp;
@@ -150,6 +154,9 @@ struct pvstate_s {
struct sigaction pv_sig_old_sigint;
struct sigaction pv_sig_old_sighup;
struct sigaction pv_sig_old_sigterm;
#ifdef SA_SIGINFO
struct sigaction pv_sig_old_sigusr2;
#endif
/*****************
* Display state *
+8
View File
@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <signal.h>
#include <time.h>
#include <sys/types.h>
@@ -200,6 +201,13 @@ extern off_t pv_calc_total_size(pvstate_t);
*/
extern void pv_sig_init(pvstate_t);
#ifdef SA_SIGINFO
/*
* Return true if SIGUSR2 has been received, and indicate the sender.
*/
extern bool pv_sigusr2_received(pvstate_t, pid_t *);
#endif
/*
* Enter the main transfer loop, transferring all input files to the output.
*/