openbsd-ports/sysutils/duplicity/patches/patch-bin_duplicity
2013-03-13 02:51:42 +00:00

20 lines
1.0 KiB
Plaintext

$OpenBSD: patch-bin_duplicity,v 1.4 2013/03/13 02:51:42 brad Exp $
--- bin/duplicity.orig Wed Jan 23 09:35:57 2013
+++ bin/duplicity Sat Feb 2 00:13:24 2013
@@ -1151,9 +1151,12 @@ def check_resources(action):
log.ErrorCode.get_ulimit_failed)
maxopen = min([l for l in (soft, hard) if l > -1])
if maxopen < 1024:
- log.FatalError(_("Max open files of %s is too low, should be >= 1024.\n"
- "Use 'ulimit -n 1024' or higher to correct.\n") % (maxopen,),
- log.ErrorCode.maxopen_too_low)
+ try:
+ resource.setrlimit(resource.RLIMIT_NOFILE, (1024, hard))
+ except resource.error:
+ log.FatalError(_("Max open files of %s is too low, should be >= 1024.\n"
+ "Use 'ulimit -n 1024' or higher to correct.\n") % (maxopen,),
+ log.ErrorCode.maxopen_too_low)
def log_startup_parms(verbosity=log.INFO):
"""