]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
SIZE_MAX is not available on all platforms
authorMark Andrews <marka@daemon.lab.isc.org>
Fri, 1 Mar 2013 01:12:17 +0000 (01:12 +0000)
committerMark Andrews <marka@daemon.lab.isc.org>
Fri, 1 Mar 2013 01:12:49 +0000 (01:12 +0000)
(cherry picked from commit 3fadb11b940a21e05f9eff4d258d67550c0567b7)

bin/named/server.c

index 057f19562519e62b81dc9fb7f65b5beb662cf1a9..a90cb4cf4ad86eecc67b9aae831e6bed0f7911db 100644 (file)
 #define PATH_MAX 1024
 #endif
 
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
+#endif
+
 /*%
  * Check an operation for failure.  Assumes that the function
  * using it has a 'result' variable and a 'cleanup' label.
@@ -1783,10 +1787,10 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                                            "%" ISC_PRINT_QUADFORMAT "u' "
                                            "is too large for this "
                                            "system; reducing to %lu",
-                                           value, SIZE_MAX);
+                                           value, (unsigned long)SIZE_MAX);
                                value = SIZE_MAX;
                        }
-                       max_cache_size = (size_t) value;
+                       max_acache_size = (size_t) value;
                }
                dns_acache_setcachesize(view->acache, max_acache_size);
        }
@@ -1980,7 +1984,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                                    "%" ISC_PRINT_QUADFORMAT "u' "
                                    "is too large for this "
                                    "system; reducing to %lu",
-                                   value, SIZE_MAX);
+                                   value, (unsigned long)SIZE_MAX);
                        value = SIZE_MAX;
                }
                max_cache_size = (size_t) value;