From patchwork Wed Aug 4 22:01:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?J=CE=B5an_Sacren?= X-Patchwork-Id: 117154 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o74M0unR008214 for ; Wed, 4 Aug 2010 22:00:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756207Ab0HDWAz (ORCPT ); Wed, 4 Aug 2010 18:00:55 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:59909 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686Ab0HDWAz (ORCPT ); Wed, 4 Aug 2010 18:00:55 -0400 Received: by pvc7 with SMTP id 7so2227348pvc.19 for ; Wed, 04 Aug 2010 15:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition; bh=3dZVfH//wl2JcSXPjqP6yfxogdIloVnBTm0dDbVCVbM=; b=I/9FcjOUdEwphzPYu7wHJwe4tpOZRsAoOj8KQF51HJH+YchyJ1xqAPqsoGV6OpIVVG qwNMFE3vQWpgMpBZiAESdev0ouhWvs7KUtaXeizmDaMNuAiQfWjuK4E9hzpLiGvqGWeC I0YaeD1+qgc/IJSStmnqFs6KjPnWluTqjDg/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition; b=tJvfWmN67eWAqEJjyL9DGnSE3j432czmmzJ+7yTdGNvZ88lp3QBlUZIgonKNKCYS8m TosLmnqNTPARtzLwcHuPMZI6crWVEsSka/t+LTlDbVs96sVEKwqxBfhUxULyt6I1vj2F 2kqi87TnIXo/l902TL01o6sLomFRiGC5TZQSg= Received: by 10.114.161.20 with SMTP id j20mr11367531wae.167.1280959254049; Wed, 04 Aug 2010 15:00:54 -0700 (PDT) Received: from localhost ([65.181.55.156]) by mx.google.com with ESMTPS id d38sm16722412wam.20.2010.08.04.15.00.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Aug 2010 15:00:52 -0700 (PDT) Date: Wed, 4 Aug 2010 16:01:02 -0600 From: Jean Sacren To: Michal Marek Cc: Jiri Kosina , Roman Zippel , linux-kbuild@vger.kernel.org Subject: [PATCH 1/2] kconfig: Fix warning: ignoring return value of 'fwrite' Message-ID: <20100804220102.GA10534@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 04 Aug 2010 22:00:56 +0000 (UTC) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c4dec80..0fe158c 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -505,7 +505,7 @@ int conf_write(const char *name) while (1) { l = strcspn(str, "\"\\"); if (l) { - fwrite(str, l, 1, out); + xfwrite(str, l, 1, out); str += l; } if (!*str) @@ -756,8 +756,8 @@ int conf_write_autoconf(void) while (1) { l = strcspn(str, "\"\\"); if (l) { - fwrite(str, l, 1, out); - fwrite(str, l, 1, out_h); + xfwrite(str, l, 1, out); + xfwrite(str, l, 1, out_h); str += l; } if (!*str) diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index d83f232..b5c47e1 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -1087,7 +1087,7 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char * static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) { - fwrite(str, strlen(str), 1, data); + xfwrite(str, strlen(str), 1, data); } void expr_fprint(struct expr *e, FILE *out) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index ce6549c..90fe55a 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -80,6 +80,13 @@ void sym_set_change_count(int count); void sym_add_change_count(int count); void conf_set_all_new_symbols(enum conf_def_mode mode); +/* confdata.c and expr.c */ +static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) +{ + if (fwrite(str, len, count, out) < count) + fprintf(stderr, "\nError in writing or end of file.\n"); +} + /* kconfig_load.c */ void kconfig_load(void);