[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dragonmtn-commits] Changes to snowwhite/main.c
From: |
Mark Loeser |
Subject: |
[Dragonmtn-commits] Changes to snowwhite/main.c |
Date: |
Sat, 16 Apr 2005 17:15:40 -0400 |
Index: snowwhite/main.c
diff -u snowwhite/main.c:1.2 snowwhite/main.c:1.3
--- snowwhite/main.c:1.2 Thu Apr 7 01:37:00 2005
+++ snowwhite/main.c Sat Apr 16 21:15:39 2005
@@ -8,7 +8,7 @@
* \wd \taz \greg \mysid
* \date 1996-2001
*
- * $Id: main.c,v 1.2 2005/04/07 01:37:00 Halcy0n Exp $
+ * $Id: main.c,v 1.3 2005/04/16 21:15:39 Halcy0n Exp $
*/
/*
@@ -48,7 +48,6 @@
#include "nickserv.h"
#include "memoserv.h"
#include "infoserv.h"
-#include "sipc.h"
#include "db.h"
#include "mass.h"
#include "log.h"
@@ -59,7 +58,6 @@
extern PGconn *dbConn;
#endif
-extern int ipcPort;
extern int svcOptFork;
/*
@@ -122,9 +120,6 @@
static int lockfile(char *);
time_t updateCloneAlerts(time_t);
-/// Master services IPC object
-IpcType servicesIpc;
-
int runAsRootOverride = 0;
/// Help for services command line
@@ -137,9 +132,7 @@
printf(" -v, --version Print version information\n");
printf(" -f, --fork Run as a daemon, fork into background\n");
printf(" -F, --nofork Stay in foreground\n");
- printf(" -i, --ipc=[PORT] Enable services IPC using PORT\n");
- printf(" -I, --noipc Disable services IPC\n");
- printf("\nReport bugs to address@hidden");
+ printf("\nReport bugs to address@hidden");
return;
}
@@ -172,15 +165,12 @@
{ "version", 0, 0, 1 },
{ "fork", 0, 0, 2 },
{ "nofork", 0, 0, 3 },
- { "ipc", 2, 0, 4 },
- { "noipc", 0, 0, 5 },
{ 0, 0, 0, 0 },
};
int lastOpt;
char ch;
- ipcPort = 0;
/* Handle options */
while ( optind < argc )
@@ -244,26 +234,6 @@
runAsRootOverride = 1;
break;
- case 'i':
- case 4: /* --ipc */
- if (optarg == NULL)
- ipcPort = 3030;
- else if (isdigit(*optarg))
- ipcPort = atoi(optarg);
-
- if (ipcPort <= 1024 || ipcPort >= SHRT_MAX) {
- printf("services: Invalid port
number.\n"
- "Must be between 1025 and %d.\n",
- SHRT_MAX);
- exit(2);
- }
- break;
-
- case 'I':
- case 5: /* --noipc */
- ipcPort = -1;
- break;
-
default:
printf("HUH?\n");
exit(100);
@@ -442,13 +412,6 @@
PQsetnonblocking(dbConn, TRUE);
#endif
- if (ipcPort == -1 || servicesIpc.start(ipcPort) < 0) {
- if (ipcPort > 0)
- printf("Could not startup ipc!\n");
- else
- printf("Ipc not enabled.\n");
- }
-
srand48(time(NULL));
srandom(time(NULL));
@@ -553,9 +516,6 @@
memset(buffer, 0, sizeof(buffer));
- servicesIpc.fdFillSet(readme);
- servicesIpc.fdFillSet(writeme);
- servicesIpc.fdFillSet(xceptme);
/*
* wait for something interesting.
@@ -563,10 +523,10 @@
#ifdef USE_SQL
cc =
- select(MAX(1+servicesIpc.getTopfd(), MAX(server,
PQsockfd) + 1), &readme, &writeme, &xceptme,
+ select(MAX(server, PQsockfd) + 1, &readme, &writeme,
&xceptme,
&tv);
#else
- cc = select(MAX(1+servicesIpc.getTopfd(), server + 1), &readme,
&writeme, &xceptme, &tv);
+ cc = select(server + 1, &readme, &writeme, &xceptme, &tv);
#endif
/*
@@ -588,8 +548,6 @@
if (next_alert_update < CTime)
next_alert_update = updateCloneAlerts(CTime);
- servicesIpc.pollAndHandle(readme, writeme, xceptme);
-
#ifdef USE_SQL
if (dbConn) {
if (FD_ISSET(PQsockfd, &xceptme)
@@ -685,4 +643,4 @@
/**********************************************************************/
-/* $Id: main.c,v 1.2 2005/04/07 01:37:00 Halcy0n Exp $ */
+/* $Id: main.c,v 1.3 2005/04/16 21:15:39 Halcy0n Exp $ */