1
- /* Copyright (c) 2000, 2011 , Oracle and/or its affiliates. All rights reserved.
1
+ /* Copyright (c) 2000, 2013 , Oracle and/or its affiliates. All rights reserved.
2
2
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
13
13
along with this program; if not, write to the Free Software
14
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15
15
16
- /* USE_MY_STREAM isn't set because we can't thrust my_fclose! */
17
-
18
16
#include "mysys_priv.h"
19
17
#include "mysys_err.h"
20
18
#include <errno.h>
@@ -98,16 +96,11 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
98
96
{
99
97
size_t writtenbytes = 0 ;
100
98
my_off_t seekptr ;
101
- #if !defined(NO_BACKGROUND ) && defined(USE_MY_STREAM )
102
- uint errors ;
103
- #endif
99
+
104
100
DBUG_ENTER ("my_fwrite" );
105
101
DBUG_PRINT ("my" ,("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d" ,
106
102
(long ) stream , (long ) Buffer , (uint ) Count , MyFlags ));
107
103
108
- #if !defined(NO_BACKGROUND ) && defined(USE_MY_STREAM )
109
- errors = 0 ;
110
- #endif
111
104
seekptr = ftell (stream );
112
105
for (;;)
113
106
{
@@ -124,26 +117,11 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
124
117
writtenbytes += written ;
125
118
Count -= written ;
126
119
}
127
- #ifdef EINTR
128
120
if (errno == EINTR )
129
121
{
130
122
(void ) my_fseek (stream ,seekptr ,MY_SEEK_SET ,MYF (0 ));
131
123
continue ;
132
124
}
133
- #endif
134
- #if !defined(NO_BACKGROUND ) && defined(USE_MY_STREAM )
135
- if (my_thread_var -> abort )
136
- MyFlags &= ~ MY_WAIT_IF_FULL ; /* End if aborted by user */
137
-
138
- if ((errno == ENOSPC || errno == EDQUOT ) &&
139
- (MyFlags & MY_WAIT_IF_FULL ))
140
- {
141
- wait_for_free_space ("[stream]" , errors );
142
- errors ++ ;
143
- (void ) my_fseek (stream ,seekptr ,MY_SEEK_SET ,MYF (0 ));
144
- continue ;
145
- }
146
- #endif
147
125
if (ferror (stream ) || (MyFlags & (MY_NABP | MY_FNABP )))
148
126
{
149
127
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP ))
0 commit comments