output and no mail client set, then only a part from job was done. The
reason was pipe, which has restricted size. rh bugzilla #247228
33 lines
1,005 B
Diff
33 lines
1,005 B
Diff
diff -up vixie-cron-4.2/src/popen.c.old vixie-cron-4.2/src/popen.c
|
|
--- vixie-cron-4.2/src/popen.c.old 2007-08-28 09:29:05.000000000 +0200
|
|
+++ vixie-cron-4.2/src/popen.c 2007-10-29 14:28:28.000000000 +0100
|
|
@@ -61,7 +61,9 @@ cron_popen(char *program, const char *ty
|
|
int argc, pdes[2];
|
|
PID_T pid;
|
|
char *argv[MAX_ARGS];
|
|
-
|
|
+ ssize_t out;
|
|
+ char buf[PIPE_BUF];
|
|
+
|
|
#ifdef __GNUC__
|
|
(void) &iop; /* Avoid fork clobbering */
|
|
#endif
|
|
@@ -106,8 +108,16 @@ cron_popen(char *program, const char *ty
|
|
}
|
|
(void)close(pdes[1]);
|
|
}
|
|
- if (execvp(argv[0], argv) < 0)
|
|
- log_it("CRON", getpid(), "Mail wan't set up, some jobs could failed", strerror(errno));
|
|
+
|
|
+ if (execvp(argv[0], argv) < 0) {
|
|
+ syslog(LOG_ERR, "CRON: Exec of (%s) failed: (%s)", program, strerror(errno));
|
|
+ if (*type != 'r') {
|
|
+ while (0 != (out = read(STDIN, buf, PIPE_BUF))) {
|
|
+ if ((out == -1) && (errno != EINTR))
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
_exit(1);
|
|
}
|
|
/* parent; assume fdopen can't fail... */
|