summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-12-10 09:41:18 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-12-10 09:41:18 +0000
commitb7286b7e9f78926c252098805d5c5c3d4dfe0ee7 (patch)
treed3968e1636d1e2478b4f9170bcb4ac55259e16d2
parentc1b4ccace4858ac2e8a4a39486723bf0e12c58a2 (diff)
downloadweechat-b7286b7e9f78926c252098805d5c5c3d4dfe0ee7.zip
Fixed bugs with /upgrade command (FIFO pipe now closed before upgrade, and
WeeChat log file descriptor closed too)
-rw-r--r--src/common/command.c12
-rw-r--r--src/common/weechat.h1
-rw-r--r--weechat/src/common/command.c12
-rw-r--r--weechat/src/common/weechat.h1
4 files changed, 22 insertions, 4 deletions
diff --git a/src/common/command.c b/src/common/command.c
index 0e29f676f..50dc1349b 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -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;
diff --git a/src/common/weechat.h b/src/common/weechat.h
index e5847fcd5..379ab80da 100644
--- a/src/common/weechat.h
+++ b/src/common/weechat.h
@@ -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
diff --git a/weechat/src/common/command.c b/weechat/src/common/command.c
index 0e29f676f..50dc1349b 100644
--- a/weechat/src/common/command.c
+++ b/weechat/src/common/command.c
@@ -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;
diff --git a/weechat/src/common/weechat.h b/weechat/src/common/weechat.h
index e5847fcd5..379ab80da 100644
--- a/weechat/src/common/weechat.h
+++ b/weechat/src/common/weechat.h
@@ -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