comparison src/os_unix.c @ 1450:1d6d99daf4dc v7.1.165

updated for version 7.1-165
author vimboss
date Sat, 01 Dec 2007 16:19:33 +0000
parents 61b50044616b
children ae7e29b64923
comparison
equal deleted inserted replaced
1449:799c1db62b42 1450:1d6d99daf4dc
308 if (p_wd) /* Unix is too fast, slow down a bit more */ 308 if (p_wd) /* Unix is too fast, slow down a bit more */
309 RealWaitForChar(read_cmd_fd, p_wd, NULL); 309 RealWaitForChar(read_cmd_fd, p_wd, NULL);
310 } 310 }
311 311
312 /* 312 /*
313 * mch_inchar(): low level input funcion. 313 * mch_inchar(): low level input function.
314 * Get a characters from the keyboard. 314 * Get a characters from the keyboard.
315 * Return the number of characters that are available. 315 * Return the number of characters that are available.
316 * If wtime == 0 do not wait for characters. 316 * If wtime == 0 do not wait for characters.
317 * If wtime == n wait a short time for characters. 317 * If wtime == n wait a short time for characters.
318 * If wtime == -1 wait forever for characters. 318 * If wtime == -1 wait forever for characters.
1565 x11_window = (Window)atol(winid); 1565 x11_window = (Window)atol(winid);
1566 1566
1567 #ifdef FEAT_XCLIPBOARD 1567 #ifdef FEAT_XCLIPBOARD
1568 if (xterm_dpy != NULL && x11_window != 0) 1568 if (xterm_dpy != NULL && x11_window != 0)
1569 { 1569 {
1570 /* Checked it already. */ 1570 /* We may have checked it already, but Gnome terminal can move us to
1571 if (x11_display_from == XD_XTERM) 1571 * another window, so we need to check every time. */
1572 return OK; 1572 if (x11_display_from != XD_XTERM)
1573 1573 {
1574 /* 1574 /*
1575 * If the X11 display was opened here before, for the window where Vim 1575 * If the X11 display was opened here before, for the window where
1576 * was started, close that one now to avoid a memory leak. 1576 * Vim was started, close that one now to avoid a memory leak.
1577 */ 1577 */
1578 if (x11_display_from == XD_HERE && x11_display != NULL) 1578 if (x11_display_from == XD_HERE && x11_display != NULL)
1579 XCloseDisplay(x11_display); 1579 XCloseDisplay(x11_display);
1580 x11_display = xterm_dpy; 1580 x11_display = xterm_dpy;
1581 x11_display_from = XD_XTERM; 1581 x11_display_from = XD_XTERM;
1582 }
1582 if (test_x11_window(x11_display) == FAIL) 1583 if (test_x11_window(x11_display) == FAIL)
1583 { 1584 {
1584 /* probably bad $WINDOWID */ 1585 /* probably bad $WINDOWID */
1585 x11_window = 0; 1586 x11_window = 0;
1586 x11_display = NULL; 1587 x11_display = NULL;
2419 2420
2420 #if defined(USE_FNAME_CASE) || defined(PROTO) 2421 #if defined(USE_FNAME_CASE) || defined(PROTO)
2421 /* 2422 /*
2422 * Set the case of the file name, if it already exists. This will cause the 2423 * Set the case of the file name, if it already exists. This will cause the
2423 * file name to remain exactly the same. 2424 * file name to remain exactly the same.
2424 * Only required for file systems where case is ingored and preserved. 2425 * Only required for file systems where case is ignored and preserved.
2425 */ 2426 */
2426 /*ARGSUSED*/ 2427 /*ARGSUSED*/
2427 void 2428 void
2428 fname_case(name, len) 2429 fname_case(name, len)
2429 char_u *name; 2430 char_u *name;
4651 # endif 4652 # endif
4652 4653
4653 ret = poll(fds, nfd, towait); 4654 ret = poll(fds, nfd, towait);
4654 # ifdef FEAT_MZSCHEME 4655 # ifdef FEAT_MZSCHEME
4655 if (ret == 0 && mzquantum_used) 4656 if (ret == 0 && mzquantum_used)
4656 /* MzThreads scheduling is required and timeout occured */ 4657 /* MzThreads scheduling is required and timeout occurred */
4657 finished = FALSE; 4658 finished = FALSE;
4658 # endif 4659 # endif
4659 4660
4660 # ifdef FEAT_SNIFF 4661 # ifdef FEAT_SNIFF
4661 if (ret < 0) 4662 if (ret < 0)
4799 ret = 0; 4800 ret = 0;
4800 } 4801 }
4801 #endif 4802 #endif
4802 # ifdef FEAT_MZSCHEME 4803 # ifdef FEAT_MZSCHEME
4803 if (ret == 0 && mzquantum_used) 4804 if (ret == 0 && mzquantum_used)
4804 /* loop if MzThreads must be scheduled and timeout occured */ 4805 /* loop if MzThreads must be scheduled and timeout occurred */
4805 finished = FALSE; 4806 finished = FALSE;
4806 # endif 4807 # endif
4807 4808
4808 # ifdef FEAT_SNIFF 4809 # ifdef FEAT_SNIFF
4809 if (ret < 0 ) 4810 if (ret < 0 )
5189 if (shell_style != STYLE_BT) 5190 if (shell_style != STYLE_BT)
5190 for (i = 0; i < num_pat; ++i) 5191 for (i = 0; i < num_pat; ++i)
5191 { 5192 {
5192 /* When using system() always add extra quotes, because the shell 5193 /* When using system() always add extra quotes, because the shell
5193 * is started twice. Otherwise put a backslash before special 5194 * is started twice. Otherwise put a backslash before special
5194 * characters, except insice ``. */ 5195 * characters, except inside ``. */
5195 #ifdef USE_SYSTEM 5196 #ifdef USE_SYSTEM
5196 STRCAT(command, " \""); 5197 STRCAT(command, " \"");
5197 STRCAT(command, pat[i]); 5198 STRCAT(command, pat[i]);
5198 STRCAT(command, "\""); 5199 STRCAT(command, "\"");
5199 #else 5200 #else
5673 if (Gpm_Open(&gpm_connect, 0) > 0) 5674 if (Gpm_Open(&gpm_connect, 0) > 0)
5674 { 5675 {
5675 /* gpm library tries to handling TSTP causes 5676 /* gpm library tries to handling TSTP causes
5676 * problems. Anyways, we close connection to Gpm whenever 5677 * problems. Anyways, we close connection to Gpm whenever
5677 * we are going to suspend or starting an external process 5678 * we are going to suspend or starting an external process
5678 * so we should'nt have problem with this 5679 * so we shouldn't have problem with this
5679 */ 5680 */
5680 signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL); 5681 signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
5681 return 1; /* succeed */ 5682 return 1; /* succeed */
5682 } 5683 }
5683 if (gpm_fd == -2) 5684 if (gpm_fd == -2)