From 72d9efc99349bf33fd55a6cb56173fd62a15445f Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 7 Oct 2025 22:17:10 +0100 Subject: [PATCH] More specific TODOs for one way of implementing #81. --- src/include/pv-internal.h | 5 ++--- src/pv/loop.c | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index fee9bd4..e835ba5 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -518,12 +518,11 @@ struct pvwatchfd_s { off_t size; /* size of whole file, 0 if unknown */ off_t position; /* position last seen at */ struct timespec start_time; /* time we started watching the fd */ - /* TODO: changes for #81, retaining closed fds for a little while: */ - /* TODO: track "closed" as well as "displayable"/"unused" */ - /* TODO: track when closed, i.e. when ready to be removed */ + struct timespec last_active; /* time the fd was last seen open (TODO, #81) */ pid_t watch_pid; /* PID to watch */ int watch_fd; /* fd to watch */ bool displayable; /* false if not displayable */ + bool inactive; /* true if the fd is now closed (TODO, #81) */ bool unused; /* true if free for re-use */ }; typedef struct pvwatchfd_s *pvwatchfd_t; diff --git a/src/pv/loop.c b/src/pv/loop.c index cd4caf5..34a1863 100644 --- a/src/pv/loop.c +++ b/src/pv/loop.c @@ -712,6 +712,7 @@ int pv_watchfd_loop(pvstate_t state) int fd; /* watched fd, or -1 for all */ pvwatchfd_t info_array; /* watch information for each fd */ int array_length; /* length of watch info array */ + /* TODO: "finished but not time to stop showing" flag for #81 */ bool finished; /* "PID:FD": fd closed; or PID gone */ } *watching; unsigned int watch_idx;