summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/popen.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/cron/popen.c')
-rw-r--r--usr.sbin/cron/popen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/cron/popen.c b/usr.sbin/cron/popen.c
index 62c3c569ff8..f02c2bb36ba 100644
--- a/usr.sbin/cron/popen.c
+++ b/usr.sbin/cron/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.19 2003/06/02 04:39:45 millert Exp $ */
+/* $OpenBSD: popen.c,v 1.20 2006/04/03 01:31:11 djm Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
@@ -41,7 +41,7 @@
#if 0
static const sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94";
#else
-static const char rcsid[] = "$OpenBSD: popen.c,v 1.19 2003/06/02 04:39:45 millert Exp $";
+static const char rcsid[] = "$OpenBSD: popen.c,v 1.20 2006/04/03 01:31:11 djm Exp $";
#endif
#endif /* not lint */
@@ -72,9 +72,8 @@ cron_popen(char *program, char *type, struct passwd *pw) {
if (!pids) {
if ((fds = sysconf(_SC_OPEN_MAX)) <= 0)
return (NULL);
- if (!(pids = (PID_T *)malloc((size_t)(fds * sizeof(PID_T)))))
+ if (!(pids = calloc(fds, sizeof(PID_T))))
return (NULL);
- bzero(pids, fds * sizeof(PID_T));
}
if (pipe(pdes) < 0)
return (NULL);