[BACK]Return to tcpbench.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tcpbench

Diff for /src/usr.bin/tcpbench/tcpbench.c between version 1.46 and 1.47

version 1.46, 2015/02/09 23:46:23 version 1.47, 2015/11/13 19:37:20
Line 986 
Line 986 
 int  int
 main(int argc, char **argv)  main(int argc, char **argv)
 {  {
         extern int optind;  
         extern char *optarg;  
         struct timeval tv;          struct timeval tv;
         unsigned int secs, rtable;          unsigned int secs, rtable;
   
Line 1108 
Line 1106 
                 }                  }
         }          }
   
           if (pledge("stdio rpath dns inet id proc", NULL) == -1)
                   err(1, "pledge");
   
         argv += optind;          argv += optind;
         argc -= optind;          argc -= optind;
         if ((argc != (ptb->sflag ? 0 : 1)) ||          if ((argc != (ptb->sflag ? 0 : 1)) ||
Line 1125 
Line 1126 
         } else          } else
                 drop_gid();                  drop_gid();
   
           if (pledge("stdio id dns inet", NULL) == -1)
                   err(1, "pledge");
   
         if (!ptb->sflag)          if (!ptb->sflag)
                 host = argv[0];                  host = argv[0];
         /*          /*
Line 1169 
Line 1173 
                         errx(1, "getaddrinfo: %s", gai_strerror(herr));                          errx(1, "getaddrinfo: %s", gai_strerror(herr));
         }          }
   
           if (pledge("stdio id inet", NULL) == -1)
                   err(1, "pledge");
   
         if (getrlimit(RLIMIT_NOFILE, &rl) == -1)          if (getrlimit(RLIMIT_NOFILE, &rl) == -1)
                 err(1, "getrlimit");                  err(1, "getrlimit");
         if (rl.rlim_cur < MAX_FD)          if (rl.rlim_cur < MAX_FD)
Line 1177 
Line 1184 
                 err(1, "setrlimit");                  err(1, "setrlimit");
         if (getrlimit(RLIMIT_NOFILE, &rl) == -1)          if (getrlimit(RLIMIT_NOFILE, &rl) == -1)
                 err(1, "getrlimit");                  err(1, "getrlimit");
   
           if (pledge("stdio inet", NULL) == -1)
                   err(1, "pledge");
   
         /* Init world */          /* Init world */
         TAILQ_INIT(&sc_queue);          TAILQ_INIT(&sc_queue);
         if ((ptb->dummybuf = malloc(ptb->dummybuf_len)) == NULL)          if ((ptb->dummybuf = malloc(ptb->dummybuf_len)) == NULL)
Line 1215 
Line 1225 
                         evtimer_add(&ev_progtimer, &tv);                          evtimer_add(&ev_progtimer, &tv);
                 }                  }
                 client_init(aitop, nconn, udp_sc, aib);                  client_init(aitop, nconn, udp_sc, aib);
   
                   if (pledge("stdio", NULL) == -1)
                           err(1, "pledge");
         }          }
   
         /* libevent main loop*/          /* libevent main loop*/
         event_dispatch();          event_dispatch();
   

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47