Mercurial > vim
comparison src/gui.c @ 8617:eab968bf3ce7 v7.4.1598
commit https://github.com/vim/vim/commit/6d8d849f5ac8a3a228c62fd29e8f40ae1b8381fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 19 14:48:31 2016 +0100
patch 7.4.1598
Problem: When starting the GUI fails a swap file is left behind. (Joerg
Plate)
Solution: Preserve files before exiting. (closes https://github.com/vim/vim/issues/692)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Mar 2016 15:00:05 +0100 |
parents | 63dc856bd13d |
children | 24b43dd167eb |
comparison
equal
deleted
inserted
replaced
8616:b3032396a708 | 8617:eab968bf3ce7 |
---|---|
103 { | 103 { |
104 #ifdef FEAT_GUI_GTK | 104 #ifdef FEAT_GUI_GTK |
105 /* If there is 'f' in 'guioptions' and specify -g argument, | 105 /* If there is 'f' in 'guioptions' and specify -g argument, |
106 * gui_mch_init_check() was not called yet. */ | 106 * gui_mch_init_check() was not called yet. */ |
107 if (gui_mch_init_check() != OK) | 107 if (gui_mch_init_check() != OK) |
108 exit(1); | 108 getout_preserve_modified(1); |
109 #endif | 109 #endif |
110 gui_attempt_start(); | 110 gui_attempt_start(); |
111 } | 111 } |
112 | 112 |
113 if (!gui.in_use) /* failed to start GUI */ | 113 if (!gui.in_use) /* failed to start GUI */ |
270 /* Child */ | 270 /* Child */ |
271 | 271 |
272 #ifdef FEAT_GUI_GTK | 272 #ifdef FEAT_GUI_GTK |
273 /* Call gtk_init_check() here after fork(). See gui_init_check(). */ | 273 /* Call gtk_init_check() here after fork(). See gui_init_check(). */ |
274 if (gui_mch_init_check() != OK) | 274 if (gui_mch_init_check() != OK) |
275 exit(1); | 275 getout_preserve_modified(1); |
276 #endif | 276 #endif |
277 | 277 |
278 # if defined(HAVE_SETSID) || defined(HAVE_SETPGID) | 278 # if defined(HAVE_SETSID) || defined(HAVE_SETPGID) |
279 /* | 279 /* |
280 * Change our process group. On some systems/shells a CTRL-C in the | 280 * Change our process group. On some systems/shells a CTRL-C in the |
307 close(pipefd[1]); | 307 close(pipefd[1]); |
308 } | 308 } |
309 | 309 |
310 /* If we failed to start the GUI, exit now. */ | 310 /* If we failed to start the GUI, exit now. */ |
311 if (!gui.in_use) | 311 if (!gui.in_use) |
312 exit(1); | 312 getout_preserve_modified(1); |
313 } | 313 } |
314 | 314 |
315 /* | 315 /* |
316 * Read from a pipe assumed to be connected to the child process (this | 316 * Read from a pipe assumed to be connected to the child process (this |
317 * function is called from the parent). | 317 * function is called from the parent). |