1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Problem with GUI startup related to XInitThreads.
12 Solution: Use read() and write() instead of fputs() and fread(). (James
17 *** ../vim-7.3.343/src/gui.c 2011-09-14 19:04:35.000000000 +0200
18 --- src/gui.c 2011-10-20 21:23:43.000000000 +0200
26 /* Setup a pipe between the child and the parent, so that the parent
27 * knows when the child has done the setsid() call and is allowed to
35 - parent_file = fdopen(pipefd[1], "w");
39 /* Try to start the GUI */
42 /* Notify the parent */
43 ! if (parent_file != NULL)
45 ! fputs(gui.in_use ? "ok" : "fail", parent_file);
46 ! fclose(parent_file);
49 /* If we failed to start the GUI, exit now. */
54 /* Try to start the GUI */
57 /* Notify the parent */
61 ! write_eintr(pipefd[1], "ok", 3);
63 ! write_eintr(pipefd[1], "fail", 5);
67 /* If we failed to start the GUI, exit now. */
71 gui_read_child_pipe(int fd)
77 ! file = fdopen(fd, "r");
79 return GUI_CHILD_IO_ERROR;
81 ! bytes_read = fread(buffer, sizeof(char), sizeof(buffer)-1, file);
82 ! buffer[bytes_read] = '\0';
84 if (strcmp(buffer, "ok") == 0)
86 return GUI_CHILD_FAILED;
89 gui_read_child_pipe(int fd)
92 ! #define READ_BUFFER_SIZE 10
93 ! char buffer[READ_BUFFER_SIZE];
95 ! bytes_read = read_eintr(fd, buffer, READ_BUFFER_SIZE - 1);
96 ! #undef READ_BUFFER_SIZE
99 return GUI_CHILD_IO_ERROR;
100 ! buffer[bytes_read] = NUL;
101 if (strcmp(buffer, "ok") == 0)
103 return GUI_CHILD_FAILED;
104 *** ../vim-7.3.343/src/version.c 2011-10-20 21:09:25.000000000 +0200
105 --- src/version.c 2011-10-20 21:27:31.000000000 +0200
109 { /* Add new patch number below this line */
115 From "know your smileys":
116 *<|:-) Santa Claus (Ho Ho Ho)
118 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
119 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
120 \\\ an exciting new programming language -- http://www.Zimbu.org ///
121 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///