In the pvwatchfd_s structure, use booleans "displayable" and "unused" instead of having values of watch_pid=0 for unused and watch_fd=-1 for not displayable, so that each item only means one thing.

This commit is contained in:
Andrew Wood
2025-09-26 23:01:07 +01:00
parent c61c589378
commit 7fdb6716e1
3 changed files with 29 additions and 16 deletions
+3 -1
View File
@@ -514,7 +514,9 @@ struct pvwatchfd_s {
off_t position; /* position last seen at */
struct timespec start_time; /* time we started watching the fd */
pid_t watch_pid; /* PID to watch */
int watch_fd; /* fd to watch, -1 = not displayed */
int watch_fd; /* fd to watch */
bool displayable; /* false if not displayable */
bool unused; /* true if free for re-use */
};
typedef struct pvwatchfd_s *pvwatchfd_t;