summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0423
blob: 3ce553fe2ff1518c3d2a5b31f88eb73b7691d6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0423
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0423
Problem:    MS-Windows: using dup-close for flushing a file.
Solution:   Use _commit(). (Ken Takata, closes #3463)
Files:	    src/memfile.c, src/os_mac.h, src/os_win32.h


*** ../vim-8.1.0422/src/memfile.c	2018-02-10 18:34:22.000000000 +0100
--- src/memfile.c	2018-09-21 14:47:04.965080463 +0200
***************
*** 539,547 ****
  {
      int		status;
      bhdr_T	*hp;
- #if defined(SYNC_DUP_CLOSE)
-     int		fd;
- #endif
      int		got_int_save = got_int;
  
      if (mfp->mf_fd < 0)	    /* there is no file, nothing to do */
--- 539,544 ----
***************
*** 624,636 ****
  		status = FAIL;
  	}
  #endif
! #ifdef SYNC_DUP_CLOSE
! 	/*
! 	 * Win32 is a bit more work: Duplicate the file handle and close it.
! 	 * This should flush the file to disk.
! 	 */
! 	if ((fd = dup(mfp->mf_fd)) >= 0)
! 	    close(fd);
  #endif
  #ifdef AMIGA
  # if defined(__AROS__) || defined(__amigaos4__)
--- 621,629 ----
  		status = FAIL;
  	}
  #endif
! #ifdef WIN32
! 	if (_commit(mfp->mf_fd))
! 	    status = FAIL;
  #endif
  #ifdef AMIGA
  # if defined(__AROS__) || defined(__amigaos4__)
*** ../vim-8.1.0422/src/os_mac.h	2018-03-01 21:50:36.000000000 +0100
--- src/os_mac.h	2018-09-21 14:47:04.965080463 +0200
***************
*** 101,107 ****
  #define HAVE_AVAIL_MEM
  
  #ifndef HAVE_CONFIG_H
- /* #define SYNC_DUP_CLOSE	   sync() a file with dup() and close() */
  # define HAVE_STRING_H
  # define HAVE_STRCSPN
  # define HAVE_MEMSET
--- 101,106 ----
*** ../vim-8.1.0422/src/os_win32.h	2018-08-21 19:47:44.724053803 +0200
--- src/os_win32.h	2018-09-21 14:47:04.965080463 +0200
***************
*** 26,32 ****
  
  #define BINARY_FILE_IO
  #define USE_EXE_NAME		/* use argv[0] for $VIM */
- #define SYNC_DUP_CLOSE		/* sync() a file with dup() and close() */
  #define USE_TERM_CONSOLE
  #ifndef HAVE_STRING_H
  # define HAVE_STRING_H
--- 26,31 ----
*** ../vim-8.1.0422/src/version.c	2018-09-21 14:43:06.795306782 +0200
--- src/version.c	2018-09-21 14:47:32.464854956 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     423,
  /**/

-- 
From "know your smileys":
 :-F	Bucktoothed vampire with one tooth missing

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///