Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/options.cfa

    r40a64f78 r2cd784a  
    2121        false, // log
    2222        false, // stats
    23         true, // interactive
    24         0, // redirect
    25         0, // redirect
    2623
    2724        { // file_cache
     
    5552        // bool sqkpoll = false;
    5653        // bool iokpoll = false;
    57         unsigned nentries = 0;
     54        unsigned nentries = 16;
    5855        bool isolate = false;
    5956
     
    6562                {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    6663                {'\0', "log",            "Enable logs", options.log, parse_settrue},
    67                 {'\0', "sout",           "Redirect standard out to file", options.reopen_stdout},
    68                 {'\0', "serr",           "Redirect standard error to file", options.reopen_stderr},
    6964                {'\0', "stats",          "Enable statistics", options.stats, parse_settrue},
    70                 {'\0', "shell",          "Disable interactive mode", options.interactive, parse_setfalse},
    7165                {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog},
    7266                {'\0', "request_len",    "Maximum number of bytes in the http request, requests with more data will be answered with Http Code 414", options.socket.buflen},
     
    8579        parse_args( argc, argv, opt, opt_cnt, "[OPTIONS]... [PATH]\ncforall http server", left );
    8680
    87         if( nentries != 0 && !is_pow2(nentries) ) {
     81        if( !is_pow2(nentries) ) {
    8882                unsigned v = nentries;
    8983                v--;
     
    137131
    138132        options.file_cache.path = path;
    139 
    140         if( options.reopen_stdout && options.reopen_stderr && 0 == strcmp(options.reopen_stdout, options.reopen_stderr) ) {
    141                 serr | "Redirect sout and serr to the same file is not supported";
    142                 exit(EXIT_FAILURE);
    143         }
    144 
    145         if( options.reopen_stdout ) {
    146                 sout | "redirecting sout to '" | options.reopen_stdout | "'";
    147                 FILE  * ret = freopen( options.reopen_stdout, "w", stdout);
    148                 if( ret == 0p ) {
    149                         serr | "Failed to redirect sout to '" | options.reopen_stdout | "'";
    150                         exit(EXIT_FAILURE);
    151                 }
    152         }
    153 
    154         if( options.reopen_stderr ) {
    155                 sout | "redirecting serr to '" | options.reopen_stderr | "'";
    156                 FILE  * ret = freopen( options.reopen_stderr, "w", stderr);
    157                 if( ret == 0p ) {
    158                         serr | "Failed to redirect serr to '" | options.reopen_stderr | "'";
    159                         exit(EXIT_FAILURE);
    160                 }
    161         }
    162133}
Note: See TracChangeset for help on using the changeset viewer.