[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+r1ZhhoPy4mNwEtLVMqpXqotKuWmUf-D50=XWpWghzdtzTfEQ@mail.gmail.com>
Date: Fri, 28 Oct 2016 16:42:18 -0700
From: Jim Davis <jim.epost@...il.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc: linux-kbuild@...r.kernel.org, Michal Marek <mmarek@...e.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 09/10] scripts/basic/fixdep: Complete error handling in print_cmdline()
On Fri, Oct 28, 2016 at 1:40 AM, SF Markus Elfring
<elfring@...rs.sourceforge.net> wrote:
> + if (printf("cmd_%s := %s\n\n", target, cmdline) < 10) {
Rather than scatter fragile magic numbers, like 10, throughout the
code, if you're hell-bent on checking for printf errors you could
write a little wrapper function that hid the magic number and bundled
up the errno stuff.
But what would you expect printf error checking to tell a user?
Perhaps that he or she ran out of disk space, but that's going to be
painfully obvious anyway in almost every case.
--
Jim
Powered by blists - more mailing lists