4 * Copyright (C) 1998 Alexandre Julliard
20 /* command-line options */
22 int persistent_server
= 0;
25 /* FIXME: should probably use getopt, and add a help option */
26 static void parse_args( int argc
, char *argv
[] )
29 for (i
= 1; i
< argc
; i
++)
31 if (argv
[i
][0] == '-')
36 if (isdigit(argv
[i
][2])) debug_level
= atoi( argv
[i
] + 2 );
40 persistent_server
= 1;
43 fprintf( stderr
, "Unknown option '%s'\n", argv
[i
] );
49 fprintf( stderr
, "Unknown argument '%s'\n", argv
[i
] );
55 static void sigterm_handler()
57 exit(1); /* make sure atexit functions get called */
60 /* initialize signal handling */
61 static void signal_init(void)
76 signal( SIGPIPE
, SIG_IGN
);
77 signal( SIGHUP
, sigterm_handler
);
78 signal( SIGINT
, sigterm_handler
);
79 signal( SIGQUIT
, sigterm_handler
);
80 signal( SIGTERM
, sigterm_handler
);
81 signal( SIGABRT
, sigterm_handler
);
84 int main( int argc
, char *argv
[] )
86 parse_args( argc
, argv
);
90 if (debug_level
) fprintf( stderr
, "Server: starting (pid=%ld)\n", (long) getpid() );
92 if (debug_level
) fprintf( stderr
, "Server: exiting (pid=%ld)\n", (long) getpid() );
97 dump_objects(); /* dump any remaining objects */