~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to src/os_unix.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-01-13 18:39:18 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090113183918-kgq1jzdwsbbex4pq
Tags: 2:7.2.079-1ubuntu1
* Resynchronise with Debian (diversions fix closes LP: #296324). Remaining
  changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
    {-1,            "Unknown!", FALSE}
316
316
};
317
317
 
 
318
/*
 
319
 * Write s[len] to the screen.
 
320
 */
318
321
    void
319
322
mch_write(s, len)
320
323
    char_u      *s;
321
324
    int         len;
322
325
{
323
 
    write(1, (char *)s, len);
 
326
    ignored = (int)write(1, (char *)s, len);
324
327
    if (p_wd)           /* Unix is too fast, slow down a bit more */
325
328
        RealWaitForChar(read_cmd_fd, p_wd, NULL);
326
329
}
2905
2908
     * Ignore any errors.
2906
2909
     */
2907
2910
#if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
2908
 
    signal_stack = malloc(SIGSTKSZ);
 
2911
    signal_stack = (char *)alloc(SIGSTKSZ);
2909
2912
    init_signal_stack();
2910
2913
#endif
2911
2914
}
2936
2939
    }
2937
2940
#  endif
2938
2941
# endif
2939
 
# ifdef FEAT_X11
 
2942
    /* Don't close the display for GTK 1, it is done in exit(). */
 
2943
# if defined(FEAT_X11) && (!defined(FEAT_GUI_GTK) || defined(HAVE_GTK2))
2940
2944
    if (x11_display != NULL
2941
2945
#  ifdef FEAT_XCLIPBOARD
2942
2946
            && x11_display != xterm_dpy
3926
3930
                 */
3927
3931
                if (fd >= 0)
3928
3932
                {
3929
 
                    dup(fd); /* To replace stdin  (file descriptor 0) */
3930
 
                    dup(fd); /* To replace stdout (file descriptor 1) */
3931
 
                    dup(fd); /* To replace stderr (file descriptor 2) */
 
3933
                    ignored = dup(fd); /* To replace stdin  (fd 0) */
 
3934
                    ignored = dup(fd); /* To replace stdout (fd 1) */
 
3935
                    ignored = dup(fd); /* To replace stderr (fd 2) */
3932
3936
 
3933
3937
                    /* Don't need this now that we've duplicated it */
3934
3938
                    close(fd);
3996
4000
 
3997
4001
                    /* set up stdin/stdout/stderr for the child */
3998
4002
                    close(0);
3999
 
                    dup(pty_slave_fd);
 
4003
                    ignored = dup(pty_slave_fd);
4000
4004
                    close(1);
4001
 
                    dup(pty_slave_fd);
 
4005
                    ignored = dup(pty_slave_fd);
4002
4006
                    if (gui.in_use)
4003
4007
                    {
4004
4008
                        close(2);
4005
 
                        dup(pty_slave_fd);
 
4009
                        ignored = dup(pty_slave_fd);
4006
4010
                    }
4007
4011
 
4008
4012
                    close(pty_slave_fd);    /* has been dupped, close it now */
4013
4017
                    /* set up stdin for the child */
4014
4018
                    close(fd_toshell[1]);
4015
4019
                    close(0);
4016
 
                    dup(fd_toshell[0]);
 
4020
                    ignored = dup(fd_toshell[0]);
4017
4021
                    close(fd_toshell[0]);
4018
4022
 
4019
4023
                    /* set up stdout for the child */
4020
4024
                    close(fd_fromshell[0]);
4021
4025
                    close(1);
4022
 
                    dup(fd_fromshell[1]);
 
4026
                    ignored = dup(fd_fromshell[1]);
4023
4027
                    close(fd_fromshell[1]);
4024
4028
 
4025
4029
# ifdef FEAT_GUI
4027
4031
                    {
4028
4032
                        /* set up stderr for the child */
4029
4033
                        close(2);
4030
 
                        dup(1);
 
4034
                        ignored = dup(1);
4031
4035
                    }
4032
4036
# endif
4033
4037
                }
4158
4162
                                            && (lnum !=
4159
4163
                                                    curbuf->b_ml.ml_line_count
4160
4164
                                                    || curbuf->b_p_eol)))
4161
 
                                    write(toshell_fd, "\n", (size_t)1);
 
4165
                                    ignored = write(toshell_fd, "\n",
 
4166
                                                                   (size_t)1);
4162
4167
                                ++lnum;
4163
4168
                                if (lnum > curbuf->b_op_end.lnum)
4164
4169
                                {
6814
6819
    if (xsmp_icefd != -1)
6815
6820
    {
6816
6821
        SmcCloseConnection(xsmp.smcconn, 0, NULL);
6817
 
        vim_free(xsmp.clientid);
 
6822
        if (xsmp.clientid != NULL)
 
6823
            free(xsmp.clientid);
6818
6824
        xsmp.clientid = NULL;
6819
6825
        xsmp_icefd = -1;
6820
6826
    }