Fix save_check_tainted to properly scan the tree so that all tainted
[wine/multimedia.git] / server / main.c
blobc582f2eb84658f5a2061daf4a0777e3b0d245c37
1 /*
2 * Server main function
4 * Copyright (C) 1998 Alexandre Julliard
5 */
7 #include <ctype.h>
8 #include <fcntl.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
13 #include "object.h"
14 #include "thread.h"
16 int main( int argc, char *argv[] )
18 int fd;
20 if (argc != 2) goto error;
21 if (!isdigit( *argv[1] )) goto error;
22 fd = atoi( argv[1] );
23 /* make sure the fd is valid */
24 if (fcntl( fd, F_GETFL, 0 ) == -1) goto error;
26 /* debug_level = 1; */
28 if (debug_level) fprintf( stderr, "Server: starting (pid=%ld)\n", (long) getpid() );
29 create_initial_thread( fd );
30 if (debug_level) fprintf( stderr, "Server: exiting (pid=%ld)\n", (long) getpid() );
32 #ifdef DEBUG_OBJECTS
33 dump_objects(); /* dump any remaining objects */
34 #endif
36 exit(0);
38 error:
39 fprintf( stderr, "%s: must be run from Wine.\n", argv[0] );
40 exit(1);