Fix that struct file_handle conflicts with glibc 2.14
Patch from Ubuntu to unbreak compilation with eglibc 2.14. (LP: #935540)
This commit is contained in:
10
istream.c
10
istream.c
@@ -22,8 +22,8 @@
|
|||||||
static void basic_close(int *handle);
|
static void basic_close(int *handle);
|
||||||
static int basic_read(int *handle, char *buf, int len);
|
static int basic_read(int *handle, char *buf, int len);
|
||||||
|
|
||||||
static void file_close(struct file_handle *handle);
|
static void file_close(struct io_file_handle *handle);
|
||||||
static int file_read(struct file_handle *handle, char *buf, int len);
|
static int file_read(struct io_file_handle *handle, char *buf, int len);
|
||||||
|
|
||||||
static int str_read(Str handle, char *buf, int len);
|
static int str_read(Str handle, char *buf, int len);
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ newFileStream(FILE * f, void (*closep) ())
|
|||||||
stream = New(union input_stream);
|
stream = New(union input_stream);
|
||||||
init_base_stream(&stream->base, STREAM_BUF_SIZE);
|
init_base_stream(&stream->base, STREAM_BUF_SIZE);
|
||||||
stream->file.type = IST_FILE;
|
stream->file.type = IST_FILE;
|
||||||
stream->file.handle = New(struct file_handle);
|
stream->file.handle = New(struct io_file_handle);
|
||||||
stream->file.handle->f = f;
|
stream->file.handle->f = f;
|
||||||
if (closep)
|
if (closep)
|
||||||
stream->file.handle->close = closep;
|
stream->file.handle->close = closep;
|
||||||
@@ -658,13 +658,13 @@ basic_read(int *handle, char *buf, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
file_close(struct file_handle *handle)
|
file_close(struct io_file_handle *handle)
|
||||||
{
|
{
|
||||||
handle->close(handle->f);
|
handle->close(handle->f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
file_read(struct file_handle *handle, char *buf, int len)
|
file_read(struct io_file_handle *handle, char *buf, int len)
|
||||||
{
|
{
|
||||||
return fread(buf, 1, len, handle->f);
|
return fread(buf, 1, len, handle->f);
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ struct stream_buffer {
|
|||||||
|
|
||||||
typedef struct stream_buffer *StreamBuffer;
|
typedef struct stream_buffer *StreamBuffer;
|
||||||
|
|
||||||
struct file_handle {
|
struct io_file_handle {
|
||||||
FILE *f;
|
FILE *f;
|
||||||
void (*close) ();
|
void (*close) ();
|
||||||
};
|
};
|
||||||
@@ -53,7 +53,7 @@ struct base_stream {
|
|||||||
|
|
||||||
struct file_stream {
|
struct file_stream {
|
||||||
struct stream_buffer stream;
|
struct stream_buffer stream;
|
||||||
struct file_handle *handle;
|
struct io_file_handle *handle;
|
||||||
char type;
|
char type;
|
||||||
char iseos;
|
char iseos;
|
||||||
int (*read) ();
|
int (*read) ();
|
||||||
|
Reference in New Issue
Block a user