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/cvs/config.c | |
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/cvs/config.c')
-rw-r--r-- | usr.bin/cvs/config.c | 15 |
1 files changed, 14 insertions, 1 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); } |