redmine

Commented out posix-hacks.c on Linux

@@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
17 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
  20 +#ifdef __FreeBSD__
  21 +
20 #define _GNU_SOURCE 22 #define _GNU_SOURCE
21 23
22 #include <stdio.h> 24 #include <stdio.h>
@@ -85,8 +87,11 @@ int posixhacks_deinit() { @@ -85,8 +87,11 @@ int posixhacks_deinit() {
85 while (i < (FOPEN_MAX+1)/2) { 87 while (i < (FOPEN_MAX+1)/2) {
86 close(reserved_fd[ (i<<1) ]); 88 close(reserved_fd[ (i<<1) ]);
87 close(reserved_fd[ (i<<1) + 1 ]); 89 close(reserved_fd[ (i<<1) + 1 ]);
  90 + i++;
88 } 91 }
89 92
90 return 0; 93 return 0;
91 } 94 }
92 95
  96 +#endif
  97 +
@@ -17,14 +17,20 @@ @@ -17,14 +17,20 @@
17 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20 -#ifndef __POSIX_HACKS_C 20 +#ifdef __FreeBSD__
21 -# define fopen posixhacks_fopen 21 +
22 -# define fdopen posixhacks_fdopen 22 +# ifndef __POSIX_HACKS_C
23 -# define fclose posixhacks_fclose 23 +# define fopen posixhacks_fopen
24 -#endif 24 +# define fdopen posixhacks_fdopen
  25 +# define fclose posixhacks_fclose
  26 +# endif
  27 +
25 28
26 extern int posixhacks_init(); 29 extern int posixhacks_init();
27 extern FILE *posixhacks_fopen(const char *path, const char *mode); 30 extern FILE *posixhacks_fopen(const char *path, const char *mode);
28 extern int posixhacks_fclose(FILE *fp); 31 extern int posixhacks_fclose(FILE *fp);
29 extern int posixhacks_deinit(); 32 extern int posixhacks_deinit();
30 - 33 +#else
  34 +# define posixhacks_init() (0)
  35 +# define posixhacks_deinit() (0)
  36 +#endif