Index: CvsProxyUnix.cpp =================================================================== RCS file: /scotty/cvsproxy/CvsProxyUnix.cpp,v retrieving revision 1.21 diff -c -r1.21 CvsProxyUnix.cpp *** CvsProxyUnix.cpp 14 Apr 2020 05:33:30 -0000 1.21 --- CvsProxyUnix.cpp 14 Apr 2020 14:12:04 -0000 *************** *** 103,112 **** --- 103,115 ---- CServerIo::trace(3,"Proxy receive thread starting."); #endif + int select_errno; + const char *select_err; int selecterr=1; CSocketIO sock(*s,NULL,0,true); int len; + int lenw; char buf[BUFFER_SIZE]; fd_set rfd; *************** *** 126,136 **** if((len=sock.recv(buf,sizeof(buf)))>0) { g_wait_count=0; ! write(1,buf,len); } g_wait_count=0; if(len<1) { g_bStop=true; break; } --- 129,150 ---- if((len=sock.recv(buf,sizeof(buf)))>0) { g_wait_count=0; ! lenw=write(1,buf,len); ! if(lenw<1) ! { ! #if ( ((CVSNT_PRODUCT_MAJOR==2) && (CVSNT_PRODUCT_MINOR==8) && (CVSNT_PRODUCT_PATCHLEVEL>=2)) || (defined(CVSNT_ENABLE_CLIENT_LOG)) ) ! CServerIo::trace(3,"Proxy receive thread write fail."); ! #endif ! g_bStop=true; ! break; ! } } g_wait_count=0; if(len<1) { + #if ( ((CVSNT_PRODUCT_MAJOR==2) && (CVSNT_PRODUCT_MINOR==8) && (CVSNT_PRODUCT_PATCHLEVEL>=2)) || (defined(CVSNT_ENABLE_CLIENT_LOG)) ) + CServerIo::trace(3,"Proxy receive thread recv fail."); + #endif g_bStop=true; break; } Index: windows-NT/win32.cpp =================================================================== RCS file: /cvs/cvsnt/windows-NT/win32.c,v retrieving revision 1.72.2.150.6.44.2.49 diff -c -r1.72.2.150.6.44.2.49 win32.cpp *** windows-NT/win32.cpp 9 Apr 2020 11:20:53 -0000 1.72.2.150.6.44.2.49 --- windows-NT/win32.cpp 14 Apr 2020 14:03:50 -0000 *************** *** 6118,6124 **** --- 6118,6142 ---- hRetrySem = OpenSemaphore(SYNCHRONIZE|SEMAPHORE_MODIFY_STATE ,FALSE, client_retry_semaphore); if (hRetrySem==NULL) { + LPSTR crashcmda; + char ErrUserName[UNLEN+1]; + DWORD len=sizeof(ErrUserName); + LPVOID errbuf; + DWORD lasterr = GetLastError(); + errbuf = NULL; + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,NULL,lasterr,MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPSTR)&errbuf,0,NULL); + if(!GetUserNameA(ErrUserName,&len)) + strcpy(ErrUserName,"** unknown **"); + crashcmda = GetCommandLineA(); + CServerIo::log(CServerIo::logError,"Open Semaphore failed - cannot perform retries: %s\nThis may be caused by:\n * a person trying to run 'cvsnt' rather than 'cvs'.\n * on windows x64 the cvsmanager process owner not being a member of the Administrators group.\n\nUsername: %s\nSemaphore: %S\nCommand: %s",errbuf,ErrUserName,client_retry_semaphore,(crashcmda==NULL)?"** unknown **":crashcmda); + CServerIo::trace(3,"Open Semaphore failed - cannot perform retries: %s",errbuf); + LocalFree( errbuf ); + errbuf = NULL; + printf("Please run \"cvs.exe\" not \"cvsnt.exe\".\nError cannot continue (retry).\n"); + return -1; } + else + CServerIo::trace(3,"Opened Retry Semaphore OK."); wchar_t client_semaphore[512]; swprintf(client_semaphore,L"CVSNT_client_proxy_%d",proxypid); CServerIo::trace(3,"Open the semaphore \"%S\".",client_semaphore); *************** *** 6139,6145 **** CServerIo::trace(3,"Open Semaphore failed - cannot ensure client terminates OK: %s",errbuf); LocalFree( errbuf ); errbuf = NULL; ! printf("Please run \"cvs.exe\" not \"cvsnt.exe\".\nError cannot continue.\n"); return -1; } else --- 6157,6163 ---- CServerIo::trace(3,"Open Semaphore failed - cannot ensure client terminates OK: %s",errbuf); LocalFree( errbuf ); errbuf = NULL; ! printf("Please run \"cvs.exe\" not \"cvsnt.exe\".\nError cannot continue (terminate).\n"); return -1; } else