From: Ulrich Drepper Date: Fri, 10 Aug 2001 21:40:18 +0000 (+0000) Subject: Call __fsetlocking for temporary stream. X-Git-Tag: upstream/2.30~22674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d875352b73d4e50c4a578a706378b3e51885126;p=external%2Fglibc.git Call __fsetlocking for temporary stream. --- diff --git a/libio/iovdprintf.c b/libio/iovdprintf.c index a0dda97..d7c656a 100644 --- a/libio/iovdprintf.c +++ b/libio/iovdprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997-2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,6 +27,7 @@ #include "libioP.h" #include "libio.h" +#include int _IO_vdprintf (d, format, arg) @@ -59,6 +60,9 @@ _IO_vdprintf (d, format, arg) (_IO_mask_flags (&tmpfil.file, _IO_NO_READS, _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING) | _IO_DELETE_DONT_CLOSE); +#ifdef _IO_MTSAFE_IO + __fsetlocking ((FILE *) &tmpfil, FSETLOCKING_BYCALLER); +#endif done = _IO_vfprintf ((_IO_FILE *) &tmpfil, format, arg); diff --git a/libio/obprintf.c b/libio/obprintf.c index 20e8882..c0f0e8c 100644 --- a/libio/obprintf.c +++ b/libio/obprintf.c @@ -1,5 +1,5 @@ /* Print output of stream to given obstack. - Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -28,6 +28,7 @@ #include #include #include +#include struct _IO_obstack_file @@ -166,6 +167,9 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args) obstack_blank_fast (obstack, room); new_f.ofile.obstack = obstack; +#ifdef _IO_MTSAFE_IO + __fsetlocking ((FILE *) &new_f.ofile.file, FSETLOCKING_BYCALLER); +#endif result = _IO_vfprintf ((_IO_FILE *) &new_f.ofile.file, format, args); diff --git a/libio/strops.c b/libio/strops.c index 6820275..c3b6625 100644 --- a/libio/strops.c +++ b/libio/strops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997-2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,6 +28,7 @@ #include "strfile.h" #include "libioP.h" #include +#include #if 0 /* The following definitions are for exposition only. @@ -107,6 +108,11 @@ _IO_str_init_static (sf, ptr, size, pstart) } /* A null _allocate_buffer function flags the strfile as being static. */ sf->_s._allocate_buffer = (_IO_alloc_type) 0; + +#ifdef _IO_MTSAFE_IO + /* We never have to lock this stream. */ + __fsetlocking ((FILE *) fp, FSETLOCKING_BYCALLER); +#endif } void diff --git a/libio/vasprintf.c b/libio/vasprintf.c index 852de23..8dda7d9 100644 --- a/libio/vasprintf.c +++ b/libio/vasprintf.c @@ -29,6 +29,7 @@ #include #include "libioP.h" #include "stdio.h" +#include #include "strfile.h" int @@ -60,6 +61,9 @@ _IO_vasprintf (result_ptr, format, args) sf._sbf._f._flags &= ~_IO_USER_BUF; sf._s._allocate_buffer = (_IO_alloc_type) malloc; sf._s._free_buffer = (_IO_free_type) free; +#ifdef _IO_MTSAFE_IO + __fsetlocking ((FILE *) &sf, FSETLOCKING_BYCALLER); +#endif ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args); if (ret < 0) return ret; diff --git a/libio/wstrops.c b/libio/wstrops.c index 92d7f2f..bfc71c2 100644 --- a/libio/wstrops.c +++ b/libio/wstrops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,6 +29,7 @@ #include "libioP.h" #include #include +#include #if 0 /* The following definitions are for exposition only. @@ -106,6 +107,11 @@ _IO_wstr_init_static (fp, ptr, size, pstart) } /* A null _allocate_buffer function flags the strfile as being static. */ (((_IO_strfile *) fp)->_s._allocate_buffer) = (_IO_alloc_type)0; + +#ifdef _IO_MTSAFE_IO + /* We never have to lock this stream. */ + __fsetlocking ((FILE *) fp, FSETLOCKING_BYCALLER); +#endif } void