home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 November
/
PCWorld_2000-11_cd.bin
/
Komunik
/
sambar444
/
_SETUP.1
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-18
|
1KB
|
52 lines
/*
** 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-1997
** 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);
}