diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-13 11:09:30 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-13 11:09:30 +0000 |
commit | 319f8ebef8a9e48cb74b220d4585552928549266 (patch) | |
tree | a6f292129a04b9eba6d2a2aef353e49e8b5a14e0 | |
parent | f5635f4d327c7f4ce34026c64548585dd7b59ffc (diff) | |
download | busybox-w32-319f8ebef8a9e48cb74b220d4585552928549266.tar.gz busybox-w32-319f8ebef8a9e48cb74b220d4585552928549266.tar.bz2 busybox-w32-319f8ebef8a9e48cb74b220d4585552928549266.zip |
httpd: round down sendfile byte count to 64k
*: style fixes
-rw-r--r-- | coreutils/cal.c | 2 | ||||
-rw-r--r-- | findutils/find.c | 6 | ||||
-rw-r--r-- | miscutils/ttysize.c | 2 | ||||
-rw-r--r-- | networking/httpd.c | 3 | ||||
-rw-r--r-- | selinux/runcon.c | 2 |
5 files changed, 8 insertions, 7 deletions
diff --git a/coreutils/cal.c b/coreutils/cal.c index 37aca00bb..317099385 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
@@ -45,7 +45,7 @@ static unsigned julian; | |||
45 | /* leap year -- account for Gregorian reformation in 1752 */ | 45 | /* leap year -- account for Gregorian reformation in 1752 */ |
46 | static int leap_year(unsigned yr) | 46 | static int leap_year(unsigned yr) |
47 | { | 47 | { |
48 | if (yr <= 1752) | 48 | if (yr <= 1752) |
49 | return !(yr % 4); | 49 | return !(yr % 4); |
50 | return (!(yr % 4) && (yr % 100)) || !(yr % 400); | 50 | return (!(yr % 4) && (yr % 100)) || !(yr % 400); |
51 | } | 51 | } |
diff --git a/findutils/find.c b/findutils/find.c index ea789a01c..60b2a75aa 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -475,8 +475,8 @@ static action*** parse_params(char **argv) | |||
475 | "-o\0" | 475 | "-o\0" |
476 | USE_FEATURE_FIND_NOT( "!\0" ) | 476 | USE_FEATURE_FIND_NOT( "!\0" ) |
477 | #if ENABLE_DESKTOP | 477 | #if ENABLE_DESKTOP |
478 | "-and\0" | 478 | "-and\0" |
479 | "-or\0" | 479 | "-or\0" |
480 | USE_FEATURE_FIND_NOT( "-not\0" ) | 480 | USE_FEATURE_FIND_NOT( "-not\0" ) |
481 | #endif | 481 | #endif |
482 | "-print\0" | 482 | "-print\0" |
@@ -487,7 +487,7 @@ static action*** parse_params(char **argv) | |||
487 | USE_FEATURE_FIND_EXEC( "-exec\0" ) | 487 | USE_FEATURE_FIND_EXEC( "-exec\0" ) |
488 | USE_FEATURE_FIND_PAREN( "(\0" ) | 488 | USE_FEATURE_FIND_PAREN( "(\0" ) |
489 | /* All options starting from here require argument */ | 489 | /* All options starting from here require argument */ |
490 | "-name\0" | 490 | "-name\0" |
491 | USE_FEATURE_FIND_PATH( "-path\0" ) | 491 | USE_FEATURE_FIND_PATH( "-path\0" ) |
492 | USE_FEATURE_FIND_REGEX( "-regex\0" ) | 492 | USE_FEATURE_FIND_REGEX( "-regex\0" ) |
493 | USE_FEATURE_FIND_TYPE( "-type\0" ) | 493 | USE_FEATURE_FIND_TYPE( "-type\0" ) |
diff --git a/miscutils/ttysize.c b/miscutils/ttysize.c index 51d4ec76f..5a3f5dcd4 100644 --- a/miscutils/ttysize.c +++ b/miscutils/ttysize.c | |||
@@ -16,7 +16,7 @@ int ttysize_main(int argc, char **argv) | |||
16 | { | 16 | { |
17 | unsigned w,h; | 17 | unsigned w,h; |
18 | struct winsize wsz; | 18 | struct winsize wsz; |
19 | 19 | ||
20 | w = 80; | 20 | w = 80; |
21 | h = 24; | 21 | h = 24; |
22 | if (!ioctl(0, TIOCGWINSZ, &wsz)) { | 22 | if (!ioctl(0, TIOCGWINSZ, &wsz)) { |
diff --git a/networking/httpd.c b/networking/httpd.c index 3e3117a79..9c02ad679 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1395,7 +1395,8 @@ static int sendFile(const char *url) | |||
1395 | fd++; /* write to fd #1 in inetd mode */ | 1395 | fd++; /* write to fd #1 in inetd mode */ |
1396 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE | 1396 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE |
1397 | do { | 1397 | do { |
1398 | count = sendfile(fd, f, &offset, MAXINT(ssize_t)); | 1398 | /* byte count is rounded down to 64k */ |
1399 | count = sendfile(fd, f, &offset, MAXINT(ssize_t) - 0xffff); | ||
1399 | if (count < 0) { | 1400 | if (count < 0) { |
1400 | if (offset == 0) | 1401 | if (offset == 0) |
1401 | goto fallback; | 1402 | goto fallback; |
diff --git a/selinux/runcon.c b/selinux/runcon.c index 6c3f518fc..015a23322 100644 --- a/selinux/runcon.c +++ b/selinux/runcon.c | |||
@@ -75,7 +75,7 @@ static const char runcon_longopts[] ALIGN1 = | |||
75 | "type\0" Required_argument "t" | 75 | "type\0" Required_argument "t" |
76 | "range\0" Required_argument "l" | 76 | "range\0" Required_argument "l" |
77 | "compute\0" No_argument "c" | 77 | "compute\0" No_argument "c" |
78 | "help\0" No_argument "h" | 78 | "help\0" No_argument "h" |
79 | ; | 79 | ; |
80 | #endif | 80 | #endif |
81 | 81 | ||