Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/amrctl Don't exit on ioctl failure, instead let the cal...



details:   https://anonhg.NetBSD.org/src/rev/31b76bda1eaa
branches:  trunk
changeset: 779319:31b76bda1eaa
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri May 18 14:01:34 2012 +0000

description:
Don't exit on ioctl failure, instead let the caller handle it.
This is needed so that we can detect failure of the 40LD firmware
interface and fall back to the 8LD interface.

diffstat:

 sbin/amrctl/amrctl.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 68f71a3325d4 -r 31b76bda1eaa sbin/amrctl/amrctl.c
--- a/sbin/amrctl/amrctl.c      Fri May 18 13:59:23 2012 +0000
+++ b/sbin/amrctl/amrctl.c      Fri May 18 14:01:34 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amrctl.c,v 1.8 2012/05/18 13:59:23 jakllsch Exp $      */
+/*     $NetBSD: amrctl.c,v 1.9 2012/05/18 14:01:34 jakllsch Exp $      */
 
 /*-
  * Copyright (c) 2002, Pierre David <Pierre.David%crc.u-strasbg.fr@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: amrctl.c,v 1.8 2012/05/18 13:59:23 jakllsch Exp $");
+__RCSID("$NetBSD: amrctl.c,v 1.9 2012/05/18 14:01:34 jakllsch Exp $");
 #endif
 
 #include <stdio.h>
@@ -178,7 +178,8 @@
                r = ioctl(fd, AMR_IO_COMMAND, &am);
                if (r == -1) {
                        if (errno != EBUSY) {
-                               err(EXIT_FAILURE, "ioctl enquiry");
+                               warn("ioctl enquiry");
+                               return -1;
                        } else
                                usleep(sleeptime);
                }



Home | Main Index | Thread Index | Old Index