X-Git-Url: https://git.opensvc.com/gitweb.cgi?p=multipath-tools%2F.git;a=blobdiff_plain;f=libmultipath%2Fdict.c;h=6a58fa2bd30f89674adbdd116fb11b573585bbfa;hp=b747fcdc101d2c01700ecf0ca68aca2bbc40317c;hb=646a6508c51d80767a36e6f938b7d8e9e536c5c5;hpb=581f9dd7908f1196f7bebfb69b2fc60953786251 diff --git a/libmultipath/dict.c b/libmultipath/dict.c index b747fcdc..6a58fa2b 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -2565,10 +2565,16 @@ snprint_def_rr_min_io_rq (char * buff, int len, void * data) static int snprint_max_fds (char * buff, int len, void * data) { + int r = 0, max_fds; + if (!conf->max_fds) return 0; - return snprintf(buff, len, "%d", conf->max_fds); + r = get_sys_max_fds(&max_fds); + if (!r && max_fds == conf->max_fds) + return snprintf(buff, len, "\"max\""); + else + return snprintf(buff, len, "%d", conf->max_fds); } static int