Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stty unknown error using rexec

Status
Not open for further replies.

kwhui

Programmer
Feb 2, 2006
1
0
0
CA
I am having error from running remote call in hpux. Basically we are calling remote calls using rexec. Although the command (execCmd) are carried out correctly, we receive error from the error sock (ie. sockfd2 below) "stty: : Uknown error".

The same code runs on solaris/linux, so I think this is a hpux specific problem.

Anyone has idea on why I got such error and how to make it go away?

Thanks
-wing

===================================================
My program is like this:

sock = rexec(&host, sp->s_port, userName, passWord, execCmd, &sockfd2);
if ( sock == -1 ) return;
do
{
int selectrc = 0;
nRead = 0; nRead2 = 0;

fd_set read_set;
FD_ZERO(&read_set);
FD_SET(sock, &read_set);
FD_SET(sockfd2, &read_set);

while ( (selectrc = select(FD_SETSIZE, &read_set, NULL, NULL, NULL)) == -1 && errno == EINTR );
if ( selectrc == -1 ) return;

if ( FD_ISSET(sock, &read_set) )
...

if ( FD_ISSET(sockfd2, &read_set) )
{
while ( (nRead2 = read(sockfd2, buffer2, 1024)) == -1 && errno == EINTR );
if ( nRead2 == -1 )
return;
if ( nRead2 )
sError += buffer2;

}
} while ( nRead || nRead2 ); // We had some data at the last pass -- loop to check for more

close(sock); close(sockfd2);

if ( !sError.isEmpty() ){
//print out the error msg => stty: : Unknown error
reutrn;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top