libmultipath: remove max_fds code duplication
[multipath-tools/.git] / libmpathpersist / mpath_persist.c
index 4229a94..29e7fb4 100644 (file)
@@ -31,7 +31,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/resource.h>
 
 #define __STDC_FORMAT_MACROS 1
 
@@ -48,15 +47,7 @@ mpath_lib_init (void)
                return NULL;
        }
 
-       if (conf->max_fds) {
-               struct rlimit fd_limit;
-
-               fd_limit.rlim_cur = conf->max_fds;
-               fd_limit.rlim_max = conf->max_fds;
-               if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0)
-                       condlog(0, "can't set open fds limit to %d : %s",
-                                  conf->max_fds, strerror(errno));
-       }
+       set_max_fds(conf->max_fds);
 
        return conf;
 }