blob: 2a99d2b2f69e6dab025c83aae128132a7dc081cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <survive.h>
void survivefault( struct SurviveContext * ctx, const char * fault )
{
fprintf( stderr, "Error: %s\n", fault );
exit( -1 );
}
int main()
{
struct SurviveContext * ctx = survive_init( &survivefault );
if( !ctx )
{
fprintf( stderr, "Fatal.\n" );
return 1;
}
while(survive_poll(ctx) == 0)
{
//Do stuff.
}
}
|