]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport support for gigabytes in htcacheclean to the 2.2.x branch
authorColm MacCarthaigh <colm@apache.org>
Mon, 19 Sep 2005 11:39:13 +0000 (11:39 +0000)
committerColm MacCarthaigh <colm@apache.org>
Mon, 19 Sep 2005 11:39:13 +0000 (11:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@290118 13f79535-47bb-0310-9956-ffa450edef68

support/htcacheclean.c

index 622963e99d9601f75e1e985021131751a47779c4..e065b9744e19469607f5d443de63d4e76f389ff7 100644 (file)
@@ -111,6 +111,7 @@ typedef struct {
 #define SECS_PER_MIN  60
 #define KBYTE         1024
 #define MBYTE         1048576
+#define GBYTE         1073741824
 
 #define DIRINFO (APR_FINFO_MTIME|APR_FINFO_SIZE|APR_FINFO_TYPE|APR_FINFO_LINK)
 
@@ -922,6 +923,9 @@ int main(int argc, const char * const argv[])
                         else if ((*end == 'M' || *end == 'm') && !end[1]) {
                             max *= MBYTE;
                         }
+                        else if ((*end == 'G' || *end == 'g') && !end[1]) {
+                            max *= GBYTE;
+                        }
                         else if (*end &&        /* neither empty nor [Bb] */
                                  ((*end != 'B' && *end != 'b') || end[1])) {
                             rv = APR_EGENERAL;