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

Diff for /src/usr.bin/ssh/channels.c between version 1.351 and 1.352

version 1.351, 2016/07/19 11:38:53 version 1.352, 2016/09/12 01:22:38
Line 40 
Line 40 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/param.h>  /* MIN MAX */  
 #include <sys/stat.h>  #include <sys/stat.h>
 #include <sys/ioctl.h>  #include <sys/ioctl.h>
 #include <sys/un.h>  #include <sys/un.h>
Line 239 
Line 238 
     int extusage, int nonblock, int is_tty)      int extusage, int nonblock, int is_tty)
 {  {
         /* Update the maximum file descriptor value. */          /* Update the maximum file descriptor value. */
         channel_max_fd = MAX(channel_max_fd, rfd);          channel_max_fd = MAXIMUM(channel_max_fd, rfd);
         channel_max_fd = MAX(channel_max_fd, wfd);          channel_max_fd = MAXIMUM(channel_max_fd, wfd);
         channel_max_fd = MAX(channel_max_fd, efd);          channel_max_fd = MAXIMUM(channel_max_fd, efd);
   
         if (rfd != -1)          if (rfd != -1)
                 fcntl(rfd, F_SETFD, FD_CLOEXEC);                  fcntl(rfd, F_SETFD, FD_CLOEXEC);
Line 363 
Line 362 
         for (i = 0; i < channels_alloc; i++) {          for (i = 0; i < channels_alloc; i++) {
                 c = channels[i];                  c = channels[i];
                 if (c != NULL) {                  if (c != NULL) {
                         max = MAX(max, c->rfd);                          max = MAXIMUM(max, c->rfd);
                         max = MAX(max, c->wfd);                          max = MAXIMUM(max, c->wfd);
                         max = MAX(max, c->efd);                          max = MAXIMUM(max, c->efd);
                 }                  }
         }          }
         return max;          return max;
Line 1871 
Line 1870 
   
         if (buffer_len(&c->input) < need) {          if (buffer_len(&c->input) < need) {
                 rlen = need - buffer_len(&c->input);                  rlen = need - buffer_len(&c->input);
                 len = read(c->rfd, buf, MIN(rlen, CHAN_RBUF));                  len = read(c->rfd, buf, MINIMUM(rlen, CHAN_RBUF));
                 if (len < 0 && (errno == EINTR || errno == EAGAIN))                  if (len < 0 && (errno == EINTR || errno == EAGAIN))
                         return buffer_len(&c->input);                          return buffer_len(&c->input);
                 if (len <= 0) {                  if (len <= 0) {
Line 2174 
Line 2173 
 {  {
         u_int n, sz, nfdset;          u_int n, sz, nfdset;
   
         n = MAX(*maxfdp, channel_max_fd);          n = MAXIMUM(*maxfdp, channel_max_fd);
   
         nfdset = howmany(n+1, NFDBITS);          nfdset = howmany(n+1, NFDBITS);
         /* Explicitly test here, because xrealloc isn't always called */          /* Explicitly test here, because xrealloc isn't always called */
Line 3598 
Line 3597 
 {  {
         int sock, saved_errno;          int sock, saved_errno;
         struct sockaddr_un *sunaddr;          struct sockaddr_un *sunaddr;
         char ntop[NI_MAXHOST], strport[MAX(NI_MAXSERV,sizeof(sunaddr->sun_path))];          char ntop[NI_MAXHOST], strport[MAXIMUM(NI_MAXSERV,sizeof(sunaddr->sun_path))];
   
         for (; cctx->ai; cctx->ai = cctx->ai->ai_next) {          for (; cctx->ai; cctx->ai = cctx->ai->ai_next) {
                 switch (cctx->ai->ai_family) {                  switch (cctx->ai->ai_family) {

Legend:
Removed from v.1.351  
changed lines
  Added in v.1.352