$OpenBSD: patch-bin_duplicity,v 1.8 2016/05/25 17:41:36 danj Exp $
--- bin/duplicity.orig	Tue Apr 19 13:38:57 2016
+++ bin/duplicity	Mon Apr 25 17:23:16 2016
@@ -1262,10 +1262,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):
     """
