matrix-gui-e: bump PR for init file fixes
[openembedded.git] / recipes / glibc / glibc-2.3.2 / glibc23-libio-compat.patch
blobf34a202dc3e94917238b6d027472eb92cdf738fd
1 --- glibc-2.3.2/libio/libioP.h.orig 2003-10-27 15:48:39.000000000 -0500
2 +++ glibc-2.3.2/libio/libioP.h 2003-10-27 16:04:03.000000000 -0500
3 @@ -348,6 +348,17 @@ struct _IO_FILE_plus
4 const struct _IO_jump_t *vtable;
5 };
7 +#ifdef _IO_USE_OLD_IO_FILE
8 +/* This structure is used by the compatibility code as if it were an
9 + _IO_FILE_plus, but has enough space to initialize the _mode argument
10 + of an _IO_FILE_complete. */
11 +struct _IO_FILE_complete_plus
13 + struct _IO_FILE_complete file;
14 + const struct _IO_jump_t *vtable;
15 +};
16 +#endif
18 /* Special file type for fopencookie function. */
19 struct _IO_cookie_file
21 --- glibc-2.3.2/libio/oldiofdopen.c.orig 2003-10-27 15:57:58.000000000 -0500
22 +++ glibc-2.3.2/libio/oldiofdopen.c 2003-10-27 16:11:28.000000000 -0500
23 @@ -48,7 +48,7 @@ _IO_old_fdopen (fd, mode)
24 int posix_mode = 0;
25 struct locked_FILE
27 - struct _IO_FILE_plus fp;
28 + struct _IO_FILE_complete_plus fp;
29 #ifdef _IO_MTSAFE_IO
30 _IO_lock_t lock;
31 #endif
32 @@ -89,7 +89,7 @@ _IO_old_fdopen (fd, mode)
33 Open a Stream on a File Descriptor says:
35 Although not explicitly required by POSIX.1, a good
36 - implementation of append ("a") mode would cause the
37 + implementation of append ("a") model would cause the
38 O_APPEND flag to be set.
40 (Historical implementations [such as Solaris2] do a one-time
41 @@ -112,24 +112,24 @@ _IO_old_fdopen (fd, mode)
42 if (new_f == NULL)
43 return NULL;
44 #ifdef _IO_MTSAFE_IO
45 - new_f->fp.file._lock = &new_f->lock;
46 + new_f->fp.file._file._lock = &new_f->lock;
47 #endif
48 - _IO_old_init (&new_f->fp.file, 0);
49 - _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
50 - _IO_old_file_init (&new_f->fp);
51 + _IO_old_init (&new_f->fp.file._file, 0);
52 + _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps;
53 + _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp);
54 #if !_IO_UNIFIED_JUMPTABLES
55 new_f->fp.vtable = NULL;
56 #endif
57 - if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL)
58 + if (_IO_old_file_attach (&new_f->fp.file._file, fd) == NULL)
60 - INTUSE(_IO_un_link) (&new_f->fp);
61 + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
62 free (new_f);
63 return NULL;
65 - new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
66 + new_f->fp.file._file._flags &= ~_IO_DELETE_DONT_CLOSE;
68 - new_f->fp.file._IO_file_flags =
69 - _IO_mask_flags (&new_f->fp.file, read_write,
70 + new_f->fp.file._file._IO_file_flags =
71 + _IO_mask_flags (&new_f->fp.file._file, read_write,
72 _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
74 return (_IO_FILE *) &new_f->fp;
75 --- glibc-2.3.2/libio/oldiofopen.c.orig 2003-10-27 15:57:55.000000000 -0500
76 +++ glibc-2.3.2/libio/oldiofopen.c 2003-10-27 16:11:26.000000000 -0500
77 @@ -42,7 +42,7 @@ _IO_old_fopen (filename, mode)
79 struct locked_FILE
81 - struct _IO_FILE_plus fp;
82 + struct _IO_FILE_complete_plus fp;
83 #ifdef _IO_MTSAFE_IO
84 _IO_lock_t lock;
85 #endif
86 @@ -51,17 +51,17 @@ _IO_old_fopen (filename, mode)
87 if (new_f == NULL)
88 return NULL;
89 #ifdef _IO_MTSAFE_IO
90 - new_f->fp.file._lock = &new_f->lock;
91 + new_f->fp.file._file._lock = &new_f->lock;
92 #endif
93 - _IO_old_init (&new_f->fp.file, 0);
94 - _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
95 - _IO_old_file_init (&new_f->fp);
96 + _IO_old_init (&new_f->fp.file._file, 0);
97 + _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp) = &_IO_old_file_jumps;
98 + _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fp);
99 #if !_IO_UNIFIED_JUMPTABLES
100 new_f->fp.vtable = NULL;
101 #endif
102 if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)
103 return (_IO_FILE *) &new_f->fp;
104 - INTUSE(_IO_un_link) (&new_f->fp);
105 + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fp);
106 free (new_f);
107 return NULL;
109 --- glibc-2.3.2/libio/oldiopopen.c.orig 2003-10-27 14:11:13.000000000 -0500
110 +++ glibc-2.3.2/libio/oldiopopen.c 2003-10-27 16:24:10.000000000 -0500
111 @@ -100,7 +100,7 @@ extern int _IO_dup2 __P ((int fd, int fd
113 struct _IO_proc_file
115 - struct _IO_FILE_plus file;
116 + struct _IO_FILE_complete_plus file;
117 /* Following fields must match those in class procbuf (procbuf.h) */
118 _IO_pid_t pid;
119 struct _IO_proc_file *next;
120 @@ -219,18 +219,18 @@ _IO_old_popen (command, mode)
121 if (new_f == NULL)
122 return NULL;
123 #ifdef _IO_MTSAFE_IO
124 - new_f->fpx.file.file._lock = &new_f->lock;
125 + new_f->fpx.file.file._file._lock = &new_f->lock;
126 #endif
127 - fp = &new_f->fpx.file.file;
128 - INTUSE(_IO_init) (fp, 0);
129 - _IO_JUMPS (&new_f->fpx.file) = &_IO_old_proc_jumps;
130 - _IO_old_file_init (&new_f->fpx.file);
131 + fp = &new_f->fpx.file.file._file;
132 + _IO_old_init (fp, 0);
133 + _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fpx.file) = &_IO_old_proc_jumps;
134 + _IO_old_file_init ((struct _IO_FILE_plus *) &new_f->fpx.file);
135 #if !_IO_UNIFIED_JUMPTABLES
136 new_f->fpx.file.vtable = NULL;
137 #endif
138 if (_IO_old_proc_open (fp, command, mode) != NULL)
139 return fp;
140 - INTUSE(_IO_un_link) (&new_f->fpx.file);
141 + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) &new_f->fpx.file);
142 free (new_f);
143 return NULL;