Don't keep PV_REMOTE_QUERY separate from PV_REMOTE_CONTROL after all since they will need to work together; extend pv_remote_check() so it will check for both -R and -Q signals (#101).

This commit is contained in:
Andrew Wood
2025-10-21 23:39:17 +01:00
parent b34bba8b4a
commit 590a3535d8
6 changed files with 98 additions and 54 deletions
+1 -9
View File
@@ -44,18 +44,10 @@ typedef bool _Bool;
# define __bool_true_false_are_defined 1
#endif
/* Whether "--remote" should be available. */
/* Whether "--remote" and "--query" should be available. */
#undef PV_REMOTE_CONTROL
#if HAVE_DECL_SA_SIGINFO
# if SIGINFO_PROVIDES_PID
#define PV_REMOTE_CONTROL 1
# endif
#endif
/* Whether "--query" should be available. */
#undef PV_REMOTE_QUERY
#if HAVE_DECL_SA_SIGINFO
# if SIGINFO_PROVIDES_PID
#define PV_REMOTE_QUERY 1
# endif
#endif
-4
View File
@@ -230,8 +230,6 @@ struct pvstate_s {
struct sigaction old_sigterm;
#ifdef PV_REMOTE_CONTROL
struct sigaction old_sigusr2;
#endif
#ifdef PV_REMOTE_QUERY
struct sigaction old_sigusr1;
#endif
struct sigaction old_sigalrm;
@@ -240,8 +238,6 @@ struct pvstate_s {
#ifdef PV_REMOTE_CONTROL
volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */
volatile pid_t sender_usr2; /* PID of sending process for SIGUSR2 */
#endif
#ifdef PV_REMOTE_QUERY
volatile sig_atomic_t rxusr1; /* whether SIGUSR1 was received */
volatile pid_t sender_usr1; /* PID of sending process for SIGUSR1 */
#endif
+5
View File
@@ -267,6 +267,11 @@ extern void pv_sig_init(pvstate_t);
* Return true if SIGUSR2 has been received, and indicate the sender.
*/
extern bool pv_sigusr2_received(pvstate_t, pid_t *);
/*
* Return true if SIGUSR1 has been received, and indicate the sender.
*/
extern bool pv_sigusr1_received(pvstate_t, pid_t *);
#endif
/*