Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jul 2009 23:21:27 -0700
From:      Navdeep Parhar <nparhar@gmail.com>
To:        Ed Schouten <ed@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r195637 - head/lib/libc/stdio
Message-ID:  <d04e16b70907132321x4eb9a071ga04effaeaed771de@mail.gmail.com>
In-Reply-To: <200907121309.n6CD9iXj085206@svn.freebsd.org>
References:  <200907121309.n6CD9iXj085206@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Sun, Jul 12, 2009 at 6:09 AM, Ed Schouten<ed@freebsd.org> wrote:
> Author: ed
> Date: Sun Jul 12 13:09:43 2009
> New Revision: 195637
> URL: http://svn.freebsd.org/changeset/base/195637
>
> Log:
>  Fix fwrite() to return 0 when size or nmemb are zero.

Hello Ed,

This breaks buildworld.  This change itself compiles, but once the
system's libc has this fwrite (say, after an installworld), buildworld
on that system will fail.  mklocale does not like fwrite returning 0.
And who knows if there are other programs like this out there...

....
mklocale -o am_ET.UTF-8.out /usr/src/share/mklocale/am_ET.UTF-8.src
am_ET.UTF-8.out: Inappropriate ioctl for device
*** Error code 1
Stop in /usr/src/share/mklocale.
....


I've attached a patch to mklocale that will fix the problem.

Regards,
Navdeep

[-- Attachment #2 --]
diff -r 337acaab368f usr.bin/mklocale/yacc.y
--- a/usr.bin/mklocale/yacc.y	Mon Jul 13 22:44:43 2009 -0700
+++ b/usr.bin/mklocale/yacc.y	Mon Jul 13 23:17:17 2009 -0700
@@ -730,8 +730,8 @@
     /*
      * PART 6: And finally the variable data
      */
-    if (fwrite(variable,
-	       ntohl(new_locale.variable_len), 1, fp) != 1) {
+    if (new_locale.variable_len &&
+	fwrite(variable, ntohl(new_locale.variable_len), 1, fp) != 1) {
 	perror(locale_file);
 	exit(1);
     }

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d04e16b70907132321x4eb9a071ga04effaeaed771de>