File:  [DVB] / dietlibc / libpthread / pthread_fdglue2.c
Revision 1.6: download - view: text, annotated - select for diffs
Sun Sep 14 04:40:37 2003 UTC (20 years, 8 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
  the overflow checking in strtou?ll? was broken in some cases.
    Unfortunately, correct overflow checking enlarged the routine by 20%.
    (reported by Manuel Novoa III)
  two stdio bug fixes (also reported by Manuel Novoa III)

#include "dietstdio.h"
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <pthread.h>
#include <errno.h>

extern int __stdio_atexit;
extern FILE* __stdio_init_file_nothreads(int fd,int closeonerror,int mode);

FILE* __stdio_init_file(int fd,int closeonerror,int mode) {
  pthread_mutexattr_t attr={PTHREAD_MUTEX_RECURSIVE_NP};
  FILE *tmp=__stdio_init_file_nothreads(fd,closeonerror,mode);
  if (tmp) pthread_mutex_init(&tmp->m,&attr);
  return tmp;
}

LinuxTV legacy CVS <linuxtv.org/cvs>