diff options
author | charnier <charnier@FreeBSD.org> | 2004-01-04 11:11:02 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 2004-01-04 11:11:02 +0000 |
commit | f2b6628563da10149c6ebe28063c665e2067429c (patch) | |
tree | 74752ca33b3141b6902b9f6b278d63b8457901b3 /contrib/pnpinfo | |
parent | ff71c1ede5ad1816d21ab0eae2dc089d72e20bc5 (diff) | |
download | FreeBSD-src-f2b6628563da10149c6ebe28063c665e2067429c.zip FreeBSD-src-f2b6628563da10149c6ebe28063c665e2067429c.tar.gz |
Move cvs id from comment to code. Use errx(). Add a return (0) at the end
of main().
Diffstat (limited to 'contrib/pnpinfo')
-rw-r--r-- | contrib/pnpinfo/pnpinfo.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/pnpinfo/pnpinfo.c b/contrib/pnpinfo/pnpinfo.c index dde7402..8bf6fa4 100644 --- a/contrib/pnpinfo/pnpinfo.c +++ b/contrib/pnpinfo/pnpinfo.c @@ -22,12 +22,14 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/time.h> +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -588,10 +590,8 @@ main(int argc, char **argv) #ifdef __i386__ /* Hey what about a i386_iopl() call :) */ - if (open("/dev/io", O_RDONLY) < 0) { - fprintf (stderr, "pnpinfo: Can't get I/O privilege.\n"); - exit (1); - } + if (open("/dev/io", O_RDONLY) < 0) + errx(1, "can't get I/O privilege"); #endif #ifdef __alpha__ ioperm(0x203, 0x400 - 0x203, 1); @@ -608,6 +608,7 @@ main(int argc, char **argv) } if (!num_pnp_devs) { printf("No Plug-n-Play devices were found\n"); - return 0; + return (0); } + return (0); } |