httpd: round down sendfile byte count to 64k
authorDenis Vlasenko <vda.linux@googlemail.com>
Mon, 13 Aug 2007 11:09:30 +0000 (11:09 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Mon, 13 Aug 2007 11:09:30 +0000 (11:09 -0000)
*: style fixes

coreutils/cal.c
findutils/find.c
miscutils/ttysize.c
networking/httpd.c
selinux/runcon.c

index 37aca00bb2426b3300157754f451a7647c8ca532..317099385294fba1448e6f04dee4961edaf0020b 100644 (file)
@@ -45,7 +45,7 @@ static unsigned julian;
 /* leap year -- account for Gregorian reformation in 1752 */
 static int leap_year(unsigned yr)
 {
-       if (yr <= 1752) 
+       if (yr <= 1752)
                return !(yr % 4);
        return (!(yr % 4) && (yr % 100)) || !(yr % 400);
 }
index ea789a01c5f865987a262fdd19327772b83864af..60b2a75aab9bc7f9c44f4d58d80b5e84a51e1f42 100644 (file)
@@ -475,8 +475,8 @@ static action*** parse_params(char **argv)
                                 "-o\0"
        USE_FEATURE_FIND_NOT(    "!\0"       )
 #if ENABLE_DESKTOP
-                                "-and\0"  
-                                "-or\0"   
+                                "-and\0"
+                                "-or\0"
        USE_FEATURE_FIND_NOT(    "-not\0"    )
 #endif
                                 "-print\0"
@@ -487,7 +487,7 @@ static action*** parse_params(char **argv)
        USE_FEATURE_FIND_EXEC(   "-exec\0"   )
        USE_FEATURE_FIND_PAREN(  "(\0"       )
        /* All options starting from here require argument */
-                                "-name\0" 
+                                "-name\0"
        USE_FEATURE_FIND_PATH(   "-path\0"   )
        USE_FEATURE_FIND_REGEX(  "-regex\0"  )
        USE_FEATURE_FIND_TYPE(   "-type\0"   )
index 51d4ec76f15537ad664756ed7f73a8e454b200fa..5a3f5dcd4a46bb5e963ac407eb9f43bd82a0e141 100644 (file)
@@ -16,7 +16,7 @@ int ttysize_main(int argc, char **argv)
 {
        unsigned w,h;
        struct winsize wsz;
-    
+
        w = 80;
        h = 24;
        if (!ioctl(0, TIOCGWINSZ, &wsz)) {
index 3e3117a796aaf7db160e96d92a9cb629b396a42e..9c02ad679795475db66155e6532a89bc56d1bc34 100644 (file)
@@ -1395,7 +1395,8 @@ static int sendFile(const char *url)
                fd++; /* write to fd #1 in inetd mode */
 #if ENABLE_FEATURE_HTTPD_USE_SENDFILE
        do {
-               count = sendfile(fd, f, &offset, MAXINT(ssize_t));
+               /* byte count is rounded down to 64k */
+               count = sendfile(fd, f, &offset, MAXINT(ssize_t) - 0xffff);
                if (count < 0) {
                        if (offset == 0)
                                goto fallback;
index 6c3f518fc49d0281404500aae0034693d70f5a6c..015a233225c40b0f92b9871be6f615af47615d36 100644 (file)
@@ -75,7 +75,7 @@ static const char runcon_longopts[] ALIGN1 =
        "type\0"    Required_argument "t"
        "range\0"   Required_argument "l"
        "compute\0" No_argument "c"
-       "help\0"    No_argument "h"      
+       "help\0"    No_argument "h"
        ;
 #endif