From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DNS_FROM_AHBL_RHSBL, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Date: Wed, 29 Apr 2015 20:11:53 +0200 From: Felix Janda To: Alexey Gladkov Message-ID: <20150429181152.GC1364@euler> References: <20150422190649.GE3170@euler> <554004DA.3060108@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <554004DA.3060108@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Thu, 30 Apr 2015 00:30:07 +0300 Cc: kbd@lists.altlinux.org Subject: Re: [kbd] [PATCH 5/5] Replace error() by fprintf() and perror() X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 18:12:03 -0000 Archived-At: List-Archive: Alexey Gladkov wrote: > 22.04.2015 22:06, Felix Janda пишет: > > --- > > src/kbdinfo.c | 26 ++++++++++++++++---------- > > src/setvtrgb.c | 42 ++++++++++++++++++++++++------------------ > > src/vlock/auth.c | 2 -- > > src/vlock/pam.c | 6 ++---- > > src/vlock/username.c | 12 ++++++++---- > > src/vlock/vlock.c | 11 ++++++----- > > src/vlock/vt.c | 5 ++--- > > 7 files changed, 58 insertions(+), 46 deletions(-) > > Applied, except for the last one. Please check out the master branch. Thanks for applying the other patches and for kbd_error()! Now everything compiles fine with musl libc. However kbd_error() does not behave correctly in the case that the first argument is 0 (EXIT_SUCCESS). error() does _not_ terminate the program if the first argument is EXIT_SUCCESS. Maybe have in addition a kbd_warn() so that the __attribute__((noreturn)) can stay for kbd_error() (then the exitnum argument would also become superfluous). My excuse [1] for changing the error messages (no more program name) was because the source is inconsistent. For example init_vt() in vlock/vt.c or main() in kbdinfo.c mix fprintf(stderr) and error(). It seems to me that error was mainly used as a convenient shorthand for fprint(stderr) && exit(). (Having a shorthand makes sense.) Thanks, Felix PS: Could you maybe note on the webpage that git.altlinux.org is the main git repository and might be ahead of the git.kernel.org repo? [1]: http://lists.altlinux.org/pipermail/kbd/2014-December/000487.html