[#444] io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...>

I am encountering a problem similar to the one mentioned here,

19 messages 2002/09/06
[#453] Re: io_write()/fwrite() and EINTR on Solaris — nobu.nokada@... 2002/09/08

Hi,

[#454] Re: io_write()/fwrite() and EINTR on Solaris — matz@... (Yukihiro Matsumoto) 2002/09/09

Hi

[#469] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/09

On Mon, Sep 09, 2002 at 03:55:13PM +0900, Yukihiro Matsumoto wrote:

[#479] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/10

On Tue, Sep 10, 2002 at 01:04:10AM +0900, Jos Backus wrote:

[#492] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/21

On Wed, Sep 11, 2002 at 02:23:33AM +0900, Jos Backus wrote:

missing/vsnprintf.c: printf("%+f", -0.0)

From: GOTO Kentaro <gotoken@...>
Date: 2002-09-10 01:16:23 UTC
List: ruby-core #472
printf("%+f", -0.0) prints "+0.0000000" if missing/vsnprintf.c is used.  
Could you anyone test this patch and commit?  I don't know what platforms
need this code. 

This bug was found in FreeBSD.  OpenBSD and MacOS X have too. 
http://www.freebsd.org/cgi/query-pr.cgi?pr=41823

-- Gotoken

Attachments (1)

vsnprintf.c.diff (666 Bytes, text/x-diff)
Index: vsnprintf.c
===================================================================
RCS file: /home/ruby/cvs/src/ruby/missing/vsnprintf.c,v
retrieving revision 1.7
diff -u -r1.7 vsnprintf.c
--- vsnprintf.c	6 Sep 2002 08:59:41 -0000	1.7
+++ vsnprintf.c	10 Sep 2002 00:57:35 -0000
@@ -1015,15 +1015,8 @@
 	else {
 		mode = 2;
 	}
-	if (value < 0) {
-		value = -value;
-		*sign = '-';
-	} else if (value == 0.0 && 1.0/value < 0) {
-	    *sign = '-';
-	} else {
-	    *sign = '\000';
-	}
 	digits = BSD__dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
+	*sign = dsgn != 0;
 	if (flags & ALT) {	/* Print trailing zeros */
 		bp = digits + ndigits;
 		if (ch == 'f') {

In This Thread

Prev Next