Added add_queue/remove_queue to server object operations.
[wine] / server / main.c
1 /*
2  * Server main function
3  *
4  * Copyright (C) 1998 Alexandre Julliard
5  */
6
7 #include <ctype.h>
8 #include <fcntl.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
12
13 #include "server.h"
14 #include "server/object.h"
15
16 int main( int argc, char *argv[] )
17 {
18     int fd;
19
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;
25
26     debug_level = 1;
27
28     if (debug_level) printf( "Server: starting (pid=%d)\n", getpid() );
29     server_init( fd );
30     select_loop();
31     if (debug_level) printf( "Server: exiting (pid=%d)\n", getpid() );
32     exit(0);
33
34  error:    
35     fprintf( stderr, "%s: must be run from Wine.\n", argv[0] );
36     exit(1);
37 }