summaryrefslogtreecommitdiff
path: root/sbin/savecore/savecore.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-04 16:36:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-04 16:36:14 +0000
commit1b765e91f65b03b634ebe4cc27ab4b505e30510a (patch)
treeee5c3e7936ffaeb6d4d79f3a5e9dce60e646bb98 /sbin/savecore/savecore.c
parent258e55d7987f9c48f17cafee46e1afdc6dfdfc4f (diff)
increase data size
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r--sbin/savecore/savecore.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
index 872387e174b..af60ce4a883 100644
--- a/sbin/savecore/savecore.c
+++ b/sbin/savecore/savecore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: savecore.c,v 1.15 1998/09/24 06:24:20 millert Exp $ */
+/* $OpenBSD: savecore.c,v 1.16 1998/10/04 16:36:13 millert Exp $ */
/* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)savecore.c 8.3 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $";
+static char rcsid[] = "$OpenBSD: savecore.c,v 1.16 1998/10/04 16:36:13 millert Exp $";
#endif
#endif /* not lint */
@@ -52,7 +52,9 @@ static char rcsid[] = "$NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $"
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/syslog.h>
+#include <sys/types.h>
#include <sys/time.h>
+#include <sys/resource.h>
#include <dirent.h>
#include <errno.h>
@@ -142,10 +144,18 @@ main(argc, argv)
int argc;
char *argv[];
{
+ struct rlimit rl;
int ch;
openlog("savecore", LOG_PERROR, LOG_DAEMON);
+ /* Increase our data size to the max if we can. */
+ if (getrlimit(RLIMIT_DATA, &rl) == 0) {
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_DATA, &rl) < 0)
+ syslog(LOG_WARNING, "can't set rlimit data size: %m");
+ }
+
while ((ch = getopt(argc, argv, "cdfN:vz")) != -1)
switch(ch) {
case 'c':