X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/68ff929f3d4d614c131b8e3b67052ba0a2bbec8e..40c6b59b6340a6fc459020c64f5ee35a842a02c7:/src/restart.c diff --git a/src/restart.c b/src/restart.c index cc831e4..a44cf08 100644 --- a/src/restart.c +++ b/src/restart.c @@ -18,21 +18,20 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id: restart.c 3249 2007-03-05 18:51:17Z nenolod $ + * $Id: restart.c 24244 2007-08-22 19:04:55Z androsyn $ */ #include "stdinc.h" -#include "tools.h" #include "restart.h" -#include "common.h" #include "ircd.h" #include "send.h" -#include "s_log.h" -#include "client.h" /* for FLAGS_ALL */ -#include "memory.h" +#include "logger.h" +#include "s_conf.h" +#include "client.h" +#include "ircd_signal.h" /* external var */ extern char **myargv; @@ -55,25 +54,31 @@ void server_reboot(void) { int i; + char path[PATH_MAX+1]; sendto_realops_snomask(SNO_GENERAL, L_ALL, "Restarting server..."); ilog(L_MAIN, "Restarting server..."); + /* * XXX we used to call flush_connections() here. But since this routine * doesn't exist anymore, we won't be flushing. This is ok, since - * when close handlers come into existance, comm_close() will be called + * when close handlers come into existance, rb_close() will be called * below, and the data flushing will be implicit. * -- adrian * * bah, for now, the program ain't coming back to here, so forcibly * close everything the "wrong" way for now, and just LEAVE... */ - for (i = 0; i < MAXCONNECTIONS; ++i) + for (i = 0; i < maxconnections; ++i) close(i); unlink(pidFileName); - execv(SPATH, myargv); + execv(SPATH, (void *)myargv); + /* use this if execv of SPATH fails */ + rb_snprintf(path, sizeof(path), "%s/bin/ircd", ConfigFileEntry.dpath); + + execv(path, (void *)myargv); exit(-1); }