OSSP CVS Repository

ossp - Check-in [1037]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1037
Date: 2001-Sep-26 11:13:27 (local)
2001-Sep-26 09:13:27 (UTC)
User:ms
Branch:
Comment: Removed magic number, corrected comment.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ch_pipe.c      1.16 -> 1.17     5 inserted, 4 deleted

ossp-pkg/l2/l2_ch_pipe.c 1.16 -> 1.17

--- l2_ch_pipe.c 2001/09/25 15:22:21     1.16
+++ l2_ch_pipe.c 2001/09/26 09:13:27     1.17
@@ -34,9 +34,10 @@
 #include <signal.h>
 #include <sys/wait.h>
 
-#define L2_PIPE_MODEDIRECT   1 /* direct command execution */
-#define L2_PIPE_MODESHELL    2 /* shell  command execution */
-#define L2_PIPE_MAXARGS    256 /* shell  command execution */
+#define L2_PIPE_MODEDIRECT   1 /* direct command execution                  */
+#define L2_PIPE_MODESHELL    2 /* shell  command execution                  */
+#define L2_PIPE_WRITEFAIL    6 /* how long before real failure is indicated */
+#define L2_PIPE_MAXARGS    256 /* how many args can our piped command have  */
 
 static l2_result_t hook_close(l2_context_t *, l2_channel_t *); /* prototypes */
 
@@ -230,7 +231,7 @@
 
     /* write message to channel pipe */
     if (write(cfg->piFd[1], buf, buf_size) == -1) {
-        if ((errno == EPIPE) && (cfg->iWritefail++ < 6)) {
+        if ((errno == EPIPE) && (cfg->iWritefail++ < L2_PIPE_WRITEFAIL)) {
             hook_close(ctx, ch);
             hook_open(ctx, ch);
             return hook_write(ctx, ch, level, buf, buf_size);

CVSTrac 2.0.1