- 论坛徽章:
- 0
|
我在SCO OpenServer 5.0.5和5.0.6上编译通过可以正常执行的程序在5.0.7上不能执行,是一个服务端监听的程序,错误出现在下面的代码上
rstLclAddr.sin_family = AF_INET;/* "Internet" Address Family */
// rstLclAddr.sin_addr.s_addr = inet_addr(ClientCt.HostAddr );/* Local IP address */
rstLclAddr.sin_addr.s_addr = INADDR_ANY;
rstLclAddr.sin_port = htons(ClientCt.ClientPort);/* Set to "Echo" Port*/
if (bind (sockfd, (struct sockaddr*)&rstLclAddr, wAddrLen) < 0)
{
errnum = errno;
sprintf(strSysErrMsg,"AcptClnt: Socket Bind error! IP:%s,Port:%d. errno=%d,errMsg:%s.",ClientCt.HostAddr,ClientCt.ClientPort,errno,strerror(errnum));
fprintf(stderr,"\r%s\n",strSysErrMsg);
WriteSysLog(strSysErrMsg);
exit(1);
}
if((listen (sockfd, 100)) < 0)
{
errnum = errno;
sprintf(strSysErrMsg,"AcptClnt: Socket Listen error! errno=%d, errMsg:%s.",errno,strerror(errnum));
fprintf(stderr,"\r%s\n",strSysErrMsg);
WriteSysLog(strSysErrMsg);
exit(1);
}
fprintf(stderr,"\rAcptClnt Progress: Start Success!\n" ;
WriteSysLog("AcptClnt Progress: Start Success!" ;
/*******Init Netware ******/
for(;
{
memset(RecvRecMessage,0,MSGLEN);
memset(SendRecMessage,0,MSGLEN);
/********Accept Netware *************/
accsockfd=accept(sockfd,(struct sockaddr*) &tcp_addr,&clilen);
if(accsockfd<0)
{
errnum = errno;
sprintf(strSysErrMsg,"AcptClnt: Socket Accept failed! errno=%d, errMsg:%s.",errno,strerror(errnum));
fprintf(stderr,"\r%s\n",strSysErrMsg);
WriteSysLog(strSysErrMsg);
continue;
}
程序在accpet这个函数时报错,错误代码为14,描述为Bad Adderss
请问各位老大是什么原因啊
另外在507上编译的程序到506上运行时会报错error opening /usr/lib/libm.so.1,而且在506上确实没有这个文件
难道两个版本有这个大的区别 |
|