EasyManua.ls Logo

Case 8000 Series - Page 161

Case 8000 Series
162 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
/*------------------------------- E R R O R -------------------------------------------*/
error( message1, message2)
register char *message1;
register char *message2;
{
extern int errno; /* print system errors like perror() */
extern int sys_nerr;
extern char *sys_errlist[];
if (progname)
fprintf( stderr, ”%s: ”, progname );
fprintf ( stderr, message1, message2 );
if ((errno > 0) && (errno < sys_nerr) )
fprintf( stderr, ” (%s)”, sys_errlist[errno] );
else
fprintf( stderr, ” (%d)”, errno);
fprintf( stderr, ”\n” );
if (sock >= 0)
close(sock ); /* Required to shut down TCP/IP properly */
exit( 1);
}
/*------------------------- I N T _ F N -------------------------------------------*/
/* If an interrupt comes in (& interruptible) jump to this code */
int_fn ( )
{
close( sock ); /* Required to shut down TCP/IP properly */
exit( 1 );
}
/*------------------------- I N T E R R U P T S -----------------------------------------*/
/* Indicate willigness to handle interrupts in int_fn( ) */
/* But, if in background mode, interrupts must be left disabled */
interrupts ( )
{
if (signal( SIGINT , SIG_IGN ) != SIG_IGN) /* interrupt */
signal( SIGINT, int_fn);
if (signal( SIGQUIT, SIG_IGN) !=SIG_IGN) /* quit */
signal (SIGQUIT, int_fn);
}
/****************** End of application Software TELNET PRINTER ***************************/
X870-300351 Issue 1 H-5 Rev.0

Table of Contents

Related product manuals