diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2006-05-28 15:45:32 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2006-05-28 15:45:32 +0000 |
commit | edd99b9e84b8aff243bfe5bd74269d5227192aff (patch) | |
tree | 3eeb757ea67bd0e9b7a024248fb209b476edd4f7 /usr.bin | |
parent | be45eb300b747d87f8d5fecde6c2378b91a61153 (diff) |
teach opencvs about the dlimit keyword in CVSROOT/config.
put some trace messages in place while im here.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/config.c | 15 | ||||
-rw-r--r-- | usr.bin/cvs/includes.h | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/cvs/config.c b/usr.bin/cvs/config.c index a9c6dd45695..f9f7c678a78 100644 --- a/usr.bin/cvs/config.c +++ b/usr.bin/cvs/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.2 2006/05/27 21:10:53 joris Exp $ */ +/* $OpenBSD: config.c,v 1.3 2006/05/28 15:45:31 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -29,9 +29,12 @@ cvs_parse_configfile(void) int i; FILE *fp; size_t len; + struct rlimit rl; const char *errstr; char *p, *buf, *lbuf, *opt, *val, fpath[MAXPATHLEN]; + cvs_log(LP_TRACE, "cvs_parse_configfile()"); + i = snprintf(fpath, sizeof(fpath), "%s/%s", current_cvsroot->cr_dir, CVS_PATH_CONFIG); if (i == -1 || i >= (int)sizeof(fpath)) @@ -74,6 +77,16 @@ cvs_parse_configfile(void) if (errstr != NULL) fatal("cvs_parse_configfile: %s: %s", val, errstr); + } else if (!strcmp(opt, "dlimit")) { + if (getrlimit(RLIMIT_DATA, &rl) != -1) { + rl.rlim_cur = (int)strtonum(val, 0, INT_MAX, + &errstr); + if (errstr != NULL) + fatal("cvs_parse_configfile: %s: %s", + val, errstr); + rl.rlim_cur = rl.rlim_cur * 1024; + (void)setrlimit(RLIMIT_DATA, &rl); + } } else { cvs_log(LP_ERR, "ignoring unknown option '%s'", opt); } diff --git a/usr.bin/cvs/includes.h b/usr.bin/cvs/includes.h index 29c3b169464..08552485174 100644 --- a/usr.bin/cvs/includes.h +++ b/usr.bin/cvs/includes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: includes.h,v 1.4 2006/01/06 13:14:24 xsa Exp $ */ +/* $OpenBSD: includes.h,v 1.5 2006/05/28 15:45:31 joris Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -30,6 +30,7 @@ #include <sys/time.h> #include <sys/timeb.h> #include <sys/types.h> +#include <sys/resource.h> #include <sys/stat.h> #include <sys/param.h> #include <sys/queue.h> |