Index: ossp-pkg/l2/l2_ch_pipe.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_pipe.c,v rcsdiff -q -kk '-r1.16' '-r1.17' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_pipe.c,v' 2>/dev/null --- 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 #include -#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);