multipath: Set the default max_fds to the system max
authorBenjamin Marzinski <bmarzins@redhat.com>
Sat, 12 Nov 2011 05:10:21 +0000 (23:10 -0600)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 12 Nov 2011 10:12:17 +0000 (11:12 +0100)
Since many people don't realize that they need to set max_fds until they run
out of file descriptors, default to the system max.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/config.c
libmultipath/dict.c
libmultipath/dict.h

index 51009ac5d5707c43aa630cb7c2323985706c543c..1e9f7b7eddf944615be757a8708ee8bd3c079977 100644 (file)
@@ -493,7 +493,7 @@ load_config (char * file)
        conf->dev_type = DEV_NONE;
        conf->minio = DEFAULT_MINIO;
        conf->minio_rq = DEFAULT_MINIO_RQ;
-       conf->max_fds = 0;
+       get_sys_max_fds(&conf->max_fds);
        conf->bindings_file = set_default(DEFAULT_BINDINGS_FILE);
        conf->bindings_read_only = 0;
        conf->multipath_dir = set_default(DEFAULT_MULTIPATHDIR);
index e6b7b4a5a820f2c1e644dc1c61052d0bf7047a5e..514e589b61fa1ef885440bc75702e7fbaa4028ba 100644 (file)
@@ -255,7 +255,7 @@ def_minio_rq_handler(vector strvec)
        return 0;
 }
 
-static int
+int
 get_sys_max_fds(int *max_fds)
 {
        FILE *file;
index 5f77473e148e5110fc16e90b13300e257930632e..688eab7432181d29ec7675b755fb98e079dbe3aa 100644 (file)
@@ -6,5 +6,6 @@
 #endif
 
 void init_keywords(void);
+int get_sys_max_fds(int *);
 
 #endif /* _DICT_H */