nghttpd: Fix compile error with Android NDK

This commit is contained in:
Tatsuhiro Tsujikawa 2016-03-23 01:16:02 +09:00
parent 0f9ed40bd9
commit 4f9c78799c
1 changed files with 3 additions and 2 deletions

View File

@ -223,7 +223,6 @@ int main(int argc, char **argv) {
int option_index = 0; int option_index = 0;
int c = getopt_long(argc, argv, "DVb:c:d:ehm:n:p:va:w:W:", long_options, int c = getopt_long(argc, argv, "DVb:c:d:ehm:n:p:va:w:W:", long_options,
&option_index); &option_index);
char *end;
if (c == -1) { if (c == -1) {
break; break;
} }
@ -256,11 +255,12 @@ int main(int argc, char **argv) {
config.max_concurrent_streams = n; config.max_concurrent_streams = n;
break; break;
} }
case 'n': case 'n': {
#ifdef NOTHREADS #ifdef NOTHREADS
std::cerr << "-n: WARNING: Threading disabled at build time, " std::cerr << "-n: WARNING: Threading disabled at build time, "
<< "no threads created." << std::endl; << "no threads created." << std::endl;
#else #else
char *end;
errno = 0; errno = 0;
config.num_worker = strtoul(optarg, &end, 10); config.num_worker = strtoul(optarg, &end, 10);
if (errno == ERANGE || *end != '\0' || config.num_worker == 0) { if (errno == ERANGE || *end != '\0' || config.num_worker == 0) {
@ -269,6 +269,7 @@ int main(int argc, char **argv) {
} }
#endif // NOTHREADS #endif // NOTHREADS
break; break;
}
case 'h': case 'h':
print_help(std::cout); print_help(std::cout);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);