Skip to content

Commit afa3330

Browse files
author
Tor Didriksen
committed
Bug#16588005 REMOVE NO_BACKGROUND AND USE_MY_STREAM IFDEFS
NO_BACKGROUND and USE_MY_STREAM should go away. They are never set, and thus don't really serve a purpose.
1 parent 3b07a37 commit afa3330

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

mysys/my_fstream.c

+2-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -13,8 +13,6 @@
1313
along with this program; if not, write to the Free Software
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

16-
/* USE_MY_STREAM isn't set because we can't thrust my_fclose! */
17-
1816
#include "mysys_priv.h"
1917
#include "mysys_err.h"
2018
#include <errno.h>
@@ -98,16 +96,11 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
9896
{
9997
size_t writtenbytes =0;
10098
my_off_t seekptr;
101-
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
102-
uint errors;
103-
#endif
99+
104100
DBUG_ENTER("my_fwrite");
105101
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
106102
(long) stream, (long) Buffer, (uint) Count, MyFlags));
107103

108-
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
109-
errors=0;
110-
#endif
111104
seekptr= ftell(stream);
112105
for (;;)
113106
{
@@ -124,26 +117,11 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
124117
writtenbytes+=written;
125118
Count-=written;
126119
}
127-
#ifdef EINTR
128120
if (errno == EINTR)
129121
{
130122
(void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0));
131123
continue;
132124
}
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
147125
if (ferror(stream) || (MyFlags & (MY_NABP | MY_FNABP)))
148126
{
149127
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))

mysys/my_pread.c

-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
187187
offset+= writtenbytes;
188188
}
189189
DBUG_PRINT("error",("Write only %u bytes", (uint) writtenbytes));
190-
#ifndef NO_BACKGROUND
191190

192191
if (my_thread_var->abort)
193192
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
@@ -210,7 +209,6 @@ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
210209
/* We may come here if the file quota is exeeded */
211210
continue;
212211
}
213-
#endif
214212
break; /* Return bytes written */
215213
}
216214
if (MyFlags & (MY_NABP | MY_FNABP))

mysys/my_write.c

-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
7979
my_errno= errno;
8080
DBUG_PRINT("error",("Write only %ld bytes, error: %d",
8181
(long) writtenbytes, my_errno));
82-
#ifndef NO_BACKGROUND
8382
if (my_thread_var->abort)
8483
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
8584

@@ -106,7 +105,6 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
106105
/* We may come here if the file quota is exeeded */
107106
continue;
108107
}
109-
#endif
110108
break;
111109
}
112110
if (MyFlags & (MY_NABP | MY_FNABP))

0 commit comments

Comments
 (0)