home *** CD-ROM | disk | FTP | other *** search
- /*
- ** MAIN
- **
- ** This is the main driver for the DOS Shell driver of the Sambar
- ** Server.
- **
- ** Confidential Property of Tod Sambar
- ** (c) Copyright Tod Sambar 1995-2001
- ** All rights reserved.
- **
- **
- ** Syntax:
- **
- ** server
- **
- ** Returns:
- ** 0 The program exited successfully.
- ** 1 An error was detected.
- **
- **
- ** History:
- ** Chg# Date Description Resp
- ** ---- ------- ------------------------------------------------------- ----
- ** 12SEP95 Created sambar
- ** 18JUN00 Added SIGTERM handler sambar
- */
-
- #include <stdio.h>
- #include <sambar.h>
- #include <signal.h>
-
- static void sig_term(int sig)
- {
- fprintf(stderr, "SIGTERM caught, shutting down...\n");
- (void)sa_shutdown(0);
- }
-
- int
- main(int argc, char *argv[])
- {
- /* Handle SIGERM gracefully */
- signal(SIGINT, sig_term);
- signal(SIGTERM, sig_term);
-
- /* Execute the Sambar Server Shell */
- if (sa_server((SA_VOID *)NULL) != SA_SUCCEED)
- return (1);
-
- return(0);
- }
-
-