This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/_exit.c

21 lines
397 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
void main( int argc, char *argv[] )
{
FILE *fp;
if( argc <= 1 ) {
fprintf( stderr, "Missing argument\n" );
exit( EXIT_FAILURE );
}
fp = fopen( argv[1], "r" );
if( fp == NULL ) {
fprintf( stderr, "Unable to open '%s'\n", argv[1] );
_exit( EXIT_FAILURE );
}
fclose( fp );
_exit( EXIT_SUCCESS );
}