1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

Fixed bugs with /upgrade command (FIFO pipe now closed before upgrade, and

WeeChat log file descriptor closed too)
This commit is contained in:
Sebastien Helleu
2005-12-10 09:41:18 +00:00
parent c1b4ccace4
commit b7286b7e9f
4 changed files with 22 additions and 4 deletions
+10 -2
View File
@@ -33,6 +33,7 @@
#include "weelist.h"
#include "weeconfig.h"
#include "session.h"
#include "fifo.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
#include "../plugins/plugins.h"
@@ -2865,6 +2866,13 @@ weechat_cmd_upgrade (int argc, char **argv)
#endif
(void) config_write (NULL);
gui_end ();
fifo_remove ();
if (weechat_log_file)
fclose (weechat_log_file);
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
execvp (exec_args[0], exec_args);
@@ -2876,12 +2884,12 @@ weechat_cmd_upgrade (int argc, char **argv)
fprintf (stderr, _("%s exec failed (program: \"%s\"), exiting WeeChat\n"),
WEECHAT_ERROR,
exec_args[0]);
free (exec_args[0]);
free (exec_args[3]);
free (filename);
weechat_shutdown (EXIT_FAILURE, 0);
exit (EXIT_FAILURE);
/* never executed */
return -1;
+1
View File
@@ -98,6 +98,7 @@ extern char *weechat_argv0;
extern time_t weechat_start_time;
extern int quit_weechat;
extern char *weechat_home;
extern FILE *weechat_log_file;
extern char *local_charset;
#ifdef HAVE_GNUTLS
+10 -2
View File
@@ -33,6 +33,7 @@
#include "weelist.h"
#include "weeconfig.h"
#include "session.h"
#include "fifo.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
#include "../plugins/plugins.h"
@@ -2865,6 +2866,13 @@ weechat_cmd_upgrade (int argc, char **argv)
#endif
(void) config_write (NULL);
gui_end ();
fifo_remove ();
if (weechat_log_file)
fclose (weechat_log_file);
#ifdef HAVE_GNUTLS
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
#endif
execvp (exec_args[0], exec_args);
@@ -2876,12 +2884,12 @@ weechat_cmd_upgrade (int argc, char **argv)
fprintf (stderr, _("%s exec failed (program: \"%s\"), exiting WeeChat\n"),
WEECHAT_ERROR,
exec_args[0]);
free (exec_args[0]);
free (exec_args[3]);
free (filename);
weechat_shutdown (EXIT_FAILURE, 0);
exit (EXIT_FAILURE);
/* never executed */
return -1;
+1
View File
@@ -98,6 +98,7 @@ extern char *weechat_argv0;
extern time_t weechat_start_time;
extern int quit_weechat;
extern char *weechat_home;
extern FILE *weechat_log_file;
extern char *local_charset;
#ifdef HAVE_GNUTLS