]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
stdin/stdout: Streamline documentation of {pre,post}_select().
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 7 Oct 2021 19:22:59 +0000 (21:22 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 25 Aug 2022 13:37:26 +0000 (15:37 +0200)
Don't state the obvious and avoid talking about fd sets.

stdin.c
stdout.c

diff --git a/stdin.c b/stdin.c
index 5f9259f7171c50dbdb1e164f6bc36257f45cc253..607435d2794c66149c17c852eee95ce46ac32b7e 100644 (file)
--- a/stdin.c
+++ b/stdin.c
@@ -14,8 +14,8 @@
 #include "string.h"
 
 /*
- * If there is space left in the buffer of the stdin task add STDIN_FILENO to
- * the read fd set of s.
+ * If there is space left in the buffer of the stdin task, ask the scheduler to
+ * monitor STDIN_FILENO.
  */
 static void stdin_pre_select(struct sched *s, void *context)
 {
@@ -33,9 +33,8 @@ static void stdin_pre_select(struct sched *s, void *context)
 }
 
 /*
- * This function checks if STDIN_FILENO was included by in the read fd set of s
- * during the previous pre_select call. If so, and if STDIN_FILENO is readable,
- * data is read from stdin and fed into the buffer tree.
+ * Feed data from stdin into the buffer tree if STDIN_FILENO is ready for
+ * reading.
  */
 static int stdin_post_select(__a_unused struct sched *s, void *context)
 {
index 4af40984b909121460344a53a855a5753c10c4d0..f31b8675d2d85900f4abf88c948fc45bbfc8f128 100644 (file)
--- a/stdout.c
+++ b/stdout.c
@@ -10,7 +10,7 @@
 #include "stdout.h"
 #include "buffer_tree.h"
 
-/* Add STDOUT_FILENO to the write fd set if there is input data available. */
+/* Monitor STDOUT_FILENO if there is input data available. */
 static void stdout_pre_select(struct sched *s, void *context)
 {
        struct stdout_task *sot = context;
@@ -24,8 +24,8 @@ static void stdout_pre_select(struct sched *s, void *context)
 }
 
 /*
- * This function writes input data from the buffer tree to stdout if
- * STDOUT_FILENO is writable.
+ * If input from the buffer tree is available and STDOUT_FILENO is ready, write
+ * as much as possible.
  */
 static int stdout_post_select(struct sched *s, void *context)
 {