Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ttcomtester/teraterm/teraterm/commlib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4862 by yutakapon, Sat Mar 10 10:32:33 2012 UTC revision 4863 by yutakapon, Sun Mar 11 12:01:10 2012 UTC
# Line 675  void NamedPipeThread(void *arg) Line 675  void NamedPipeThread(void *arg)
675                          WaitForSingleObject(REnd,INFINITE);                          WaitForSingleObject(REnd,INFINITE);
676                  }                  }
677                  else {                  else {
678                          DErr = GetLastError();  // this returns 995 (operation aborted) if a USB com port is removed                          DErr = GetLastError();  // this returns 109 (broken pipe) if a named pipe is removed.
679                          if (! cv->Ready || ERROR_OPERATION_ABORTED == DErr) {                          if (! cv->Ready || ERROR_BROKEN_PIPE == DErr) {
680                                    PostMessage(cv->HWin, WM_USER_COMMNOTIFY, 0, FD_CLOSE);
681                                  _endthread();                                  _endthread();
682                          }                          }
683                  }                  }
# Line 1192  void CommSend(PComVar cv) Line 1193  void CommSend(PComVar cv)
1193    
1194                  case IdNamedPipe:                  case IdNamedPipe:
1195                          if (! PWriteFile(cv->ComID, &(cv->OutBuff[cv->OutPtr]), C, (LPDWORD)&D, NULL)) {                          if (! PWriteFile(cv->ComID, &(cv->OutBuff[cv->OutPtr]), C, (LPDWORD)&D, NULL)) {
1196                                  if (! GetLastError() == ERROR_IO_PENDING) {                                  // ERROR_IO_PENDING 以外のエラーだったら、パイプがクローズされているかもしれないが、
1197                                    // 送信できたことにする。
1198                                    if (! (GetLastError() == ERROR_IO_PENDING)) {
1199                                          D = C; /* ignore data */                                          D = C; /* ignore data */
1200                                  }                                  }
1201                          }                          }

Legend:
Removed from v.4862  
changed lines
  Added in v.4863

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26