From 8771b901d99091b3808532afd255fbbac10e0c20 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Mon, 15 Sep 2025 20:12:55 +0100 Subject: [PATCH] Add TODO markers as part of looking at supporting multiple "-d" options (#12). --- src/include/pv-internal.h | 1 + src/pv/watchpid.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index 101505f..84b4b64 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -175,6 +175,7 @@ struct pvstate_s { off_t rate_limit; /* rate limit, in bytes per second */ size_t target_buffer_size; /* buffer size (0=default) */ off_t size; /* total size of data */ + /* TODO: replace watch_pid, watch_fd with an array of structs (#12) */ pid_t watch_pid; /* process to watch fds of */ unsigned int skip_errors; /* skip read errors counter */ int watch_fd; /* fd to watch */ diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index c4cc5f4..032778a 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -449,6 +449,11 @@ int pv_watchpid_scanfds(pvstate_t state, continue; #endif + /* + * TODO: determine whether fd_to_idx really helps here, + * since it constrains us to fds < FD_SETSIZE. + */ + /* Skip if the fd is outside the array. */ if ((fd < 0) || (fd >= FD_SETSIZE)) continue;