mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
1ed4ecffa8
Removed warnings. Made the include files self-sufficient. Some Solaris fixes.
41 lines
873 B
C
41 lines
873 B
C
/*
|
|
* Server main function
|
|
*
|
|
* Copyright (C) 1998 Alexandre Julliard
|
|
*/
|
|
|
|
#include <ctype.h>
|
|
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
#include "object.h"
|
|
#include "thread.h"
|
|
|
|
int main( int argc, char *argv[] )
|
|
{
|
|
int fd;
|
|
|
|
if (argc != 2) goto error;
|
|
if (!isdigit( *argv[1] )) goto error;
|
|
fd = atoi( argv[1] );
|
|
/* make sure the fd is valid */
|
|
if (fcntl( fd, F_GETFL, 0 ) == -1) goto error;
|
|
|
|
debug_level = 1;
|
|
|
|
if (debug_level) fprintf( stderr, "Server: starting (pid=%ld)\n", (long) getpid() );
|
|
create_initial_thread( fd );
|
|
if (debug_level) fprintf( stderr, "Server: exiting (pid=%ld)\n", (long) getpid() );
|
|
|
|
#ifdef DEBUG_OBJECTS
|
|
dump_objects(); /* dump any remaining objects */
|
|
#endif
|
|
|
|
exit(0);
|
|
|
|
error:
|
|
fprintf( stderr, "%s: must be run from Wine.\n", argv[0] );
|
|
exit(1);
|
|
}
|