mirror of
https://github.com/anope/anope.git
synced 2026-07-04 18:13:13 +02:00
BUILD : 1.7.15 (1157) BUGS : 589 NOTES : Fixed restarting under windows, it should now work correctly
git-svn-id: svn://svn.anope.org/anope/trunk@1157 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@880 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
36d36419b3
commit
b092b4ea23
@@ -13,6 +13,7 @@ Provided by Anope Dev. <dev@anope.org> - 2006
|
||||
09/10 F Nick Enforcers can now be whois'd on services. [#601]
|
||||
09/10 F Corrected valid nick characters for /OS SVSNICK. [#599]
|
||||
09/17 F Small mistakes in Dutch language file. [ #00]
|
||||
09/23 F Restarting under Windows now works correctly [#589]
|
||||
|
||||
Provided by Trystan <trystan@nomadirc.net> - 2006
|
||||
08/20 F Fixed several compiler warnings. [#586]
|
||||
|
||||
+51
-17
@@ -46,6 +46,10 @@ int nothird = 0; /* -nothrid */
|
||||
int noexpire = 0; /* -noexpire */
|
||||
int protocoldebug = 0; /* -protocoldebug */
|
||||
|
||||
#ifdef _WIN32
|
||||
char *binary_dir; /* Used to store base path for win32 restart */
|
||||
#endif
|
||||
|
||||
#ifdef USE_RDB
|
||||
int do_mysql = 0; /* use mysql ? */
|
||||
#endif
|
||||
@@ -228,6 +232,12 @@ static void services_restart(void)
|
||||
/* First don't unload protocol module, then do so */
|
||||
modules_unload_all(true, false);
|
||||
modules_unload_all(true, true);
|
||||
#ifdef _WIN32
|
||||
/* This fixes bug #589 - change to binary directory for restart */
|
||||
/* -- heinz */
|
||||
if (binary_dir)
|
||||
chdir(binary_dir);
|
||||
#endif
|
||||
execve(SERVICES_BIN, my_av, my_envp);
|
||||
if (!readonly) {
|
||||
open_log();
|
||||
@@ -403,13 +413,13 @@ void sighandler(int signum)
|
||||
snprintf(buf, sizeof(buf), "saving %s", ExceptionDBName);
|
||||
break;
|
||||
case -19:
|
||||
|
||||
snprintf(buf, sizeof(buf), "Sending event %s %s",
|
||||
EVENT_DB_SAVING, EVENT_START);
|
||||
EVENT_DB_SAVING, EVENT_START);
|
||||
|
||||
break;
|
||||
break;
|
||||
case -20:
|
||||
snprintf(buf, sizeof(buf), "Sending event %s %s",
|
||||
EVENT_DB_SAVING, EVENT_STOP);
|
||||
case -20:
|
||||
break;
|
||||
case -21:
|
||||
snprintf(buf, sizeof(buf), "expiring nicknames");
|
||||
break;
|
||||
@@ -429,16 +439,16 @@ void sighandler(int signum)
|
||||
snprintf(buf, sizeof(buf), "expiring SQLINEs");
|
||||
break;
|
||||
case -29:
|
||||
break;
|
||||
case -28:
|
||||
snprintf(buf, sizeof(buf), "expiring SQLINEs");
|
||||
break;
|
||||
snprintf(buf, sizeof(buf), "expiring Exceptions");
|
||||
break;
|
||||
case -30:
|
||||
snprintf(buf, sizeof(buf), "Sending event %s %s",
|
||||
EVENT_DB_EXPIRE, EVENT_START);
|
||||
|
||||
snprintf(buf, sizeof(buf), "expiring Exceptions");
|
||||
|
||||
break;
|
||||
case -31:
|
||||
snprintf(buf, sizeof(buf), "Sending event %s %s",
|
||||
EVENT_DB_EXPIRE, EVENT_STOP);
|
||||
|
||||
break;
|
||||
default:
|
||||
snprintf(buf, sizeof(buf), "waiting=%d", waiting);
|
||||
}
|
||||
@@ -510,6 +520,18 @@ int main(int ac, char **av, char **envp)
|
||||
" require root privileges to run, and it is discouraged that you run Anope\n");
|
||||
fprintf(stderr, " as the root superuser.\n");
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* We need to know which directory we're in for when restart is called.
|
||||
* This only affects Windows as a full path is not specified in services_dir.
|
||||
* This fixes bug #589.
|
||||
* -- heinz
|
||||
*/
|
||||
binary_dir = smalloc(MAX_PATH);
|
||||
if (!getcwd(binary_dir, MAX_PATH)) {
|
||||
fprintf(stderr, "error: getcwd() error\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* General initialization first */
|
||||
@@ -633,6 +655,12 @@ int main(int ac, char **av, char **envp)
|
||||
anope_cmd_squit(ServerName, quitmsg);
|
||||
disconn(servsock);
|
||||
close_log();
|
||||
#ifdef _WIN32
|
||||
/* This fixes bug #589 - change to binary directory for restart */
|
||||
/* -- heinz */
|
||||
if (binary_dir)
|
||||
chdir(binary_dir);
|
||||
#endif
|
||||
execve(SERVICES_BIN, av, envp);
|
||||
if (!readonly) {
|
||||
open_log();
|
||||
@@ -648,6 +676,12 @@ int main(int ac, char **av, char **envp)
|
||||
|
||||
/* Disconnect and exit */
|
||||
services_shutdown();
|
||||
|
||||
#ifdef _WIN32
|
||||
if (binary_dir)
|
||||
free(binary_dir);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -680,9 +714,9 @@ void do_backtrace(int show_segheader)
|
||||
#endif
|
||||
#else
|
||||
char *winver;
|
||||
version_build, version_flags);
|
||||
size = backtrace(array, 10);
|
||||
strings = backtrace_symbols(array, size);
|
||||
for (i = 0; i < size; i++) {
|
||||
winver = GetWindowsVersion();
|
||||
alog("Backtrace: not available on Windows");
|
||||
alog("Running %S", winver);
|
||||
free(winver);
|
||||
#endif
|
||||
}
|
||||
|
||||
+5
-1
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="15"
|
||||
VERSION_EXTRA="-svn"
|
||||
VERSION_BUILD="1156"
|
||||
VERSION_BUILD="1157"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.15 (1157)
|
||||
# BUGS : 589
|
||||
# NOTES : Fixed restarting under windows, it should now work correctly
|
||||
#
|
||||
# BUILD : 1.7.15 (1156)
|
||||
# BUGS :
|
||||
# NOTES : Another small fix in nl.l
|
||||
|
||||
Reference in New Issue
Block a user