Diff for /libaitcli/src/aitcli.c between versions 1.13 and 1.15

version 1.13, 2013/12/03 20:33:14 version 1.15, 2016/08/18 09:27:37
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013Copyright 2004 - 2016
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 1304  cliReadLine(linebuffer_t * __restrict cli_buffer, int  Line 1304  cliReadLine(linebuffer_t * __restrict cli_buffer, int 
   
                 memset(buf, 0, sizeof buf);                  memset(buf, 0, sizeof buf);
                 readLen = read(cli_buffer->line_in, buf, BUFSIZ);                  readLen = read(cli_buffer->line_in, buf, BUFSIZ);
                if (readLen == -1) {                if (readLen < 1) {
                        LOGERR;                        if (readLen)
                        return str;                                LOGERR;
                         return NULL;
                 }                  }
                 if (!readLen) {  
                         if (cli_buffer->line_buf)  
                                 str = e_strdup(cli_buffer->line_buf);  
                         else  
                                 cli_SetErr(EPIPE, "Unknown state ...");  
                         return str;  
                 }  
   
 recheck:  recheck:
                 for (code = RETCODE_OK, i = MAX_BINDKEY - 1; i > -1; i--)                  for (code = RETCODE_OK, i = MAX_BINDKEY - 1; i > -1; i--)
Line 1361  cliNetLoop(linebuffer_t * __restrict cli_buffer, const Line 1355  cliNetLoop(linebuffer_t * __restrict cli_buffer, const
                 int sock, int timeout)                  int sock, int timeout)
 {  {
         u_char buf[BUFSIZ];          u_char buf[BUFSIZ];
        int pid, stat, pty, r, s, alen, flg, attrlen = 0, ret = 0;        int pid, stat, pty, s, alen, flg, attrlen = 0, ret = 0;
         fd_set fds;          fd_set fds;
         struct timeval tv = { DEFAULT_SOCK_TIMEOUT, 0 };          struct timeval tv = { DEFAULT_SOCK_TIMEOUT, 0 };
         struct telnetAttrs *a, Attr[10];          struct telnetAttrs *a, Attr[10];
Line 1406  cliNetLoop(linebuffer_t * __restrict cli_buffer, const Line 1400  cliNetLoop(linebuffer_t * __restrict cli_buffer, const
                                         break;                                          break;
                                 }                                  }
   
                                 r = FD_ISSET(sock, &fds) ? sock : pty;  
                                 s = FD_ISSET(sock, &fds) ? pty : sock;                                  s = FD_ISSET(sock, &fds) ? pty : sock;
   
                                 if (FD_ISSET(sock, &fds)) {                                  if (FD_ISSET(sock, &fds)) {
Line 1446  cliNetLoop(linebuffer_t * __restrict cli_buffer, const Line 1439  cliNetLoop(linebuffer_t * __restrict cli_buffer, const
   
                                 if (FD_ISSET(pty, &fds)) {                                  if (FD_ISSET(pty, &fds)) {
                                         memset(buf, 0, BUFSIZ);                                          memset(buf, 0, BUFSIZ);
                                        if ((ret = read(pty, buf, BUFSIZ)) == -1) {                                        if ((ret = read(pty, buf, BUFSIZ)) < 1) {
                                                LOGERR;                                                if (ret)
                                                         LOGERR;
                                                 break;                                                  break;
                                         }                                          }
   

Removed from v.1.13  
changed lines
  Added in v.1.15


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>