diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2008-02-28 11:22:13 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2008-02-28 11:22:13 +0000 |
commit | 595436a6582e11d40fa1bc60ae1d9327d1f16ede (patch) | |
tree | 216a78b227b7860fc395e9113e45875341240404 /sbin/ldattach/ldattach.c | |
parent | a83361e59eca6b9ecbbfacb0af2f1371153d239a (diff) |
Log an error if a device can not be opened, only log line discipline attachment
when the line discipline has really been attached. And a few manual tweaks.
Diffstat (limited to 'sbin/ldattach/ldattach.c')
-rw-r--r-- | sbin/ldattach/ldattach.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/ldattach/ldattach.c b/sbin/ldattach/ldattach.c index 19667b08ed7..db3549e1a1e 100644 --- a/sbin/ldattach/ldattach.c +++ b/sbin/ldattach/ldattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldattach.c,v 1.4 2008/01/05 17:33:28 mbalmer Exp $ */ +/* $OpenBSD: ldattach.c,v 1.5 2008/02/28 11:22:12 mbalmer Exp $ */ /* * Copyright (c) 2007, 2008 Marc Balmer <mbalmer@openbsd.org> @@ -153,9 +153,10 @@ main(int argc, char *argv[]) goto bail_out; } - syslog(LOG_INFO, "attach %s on %s", disc, dev); - if ((fd = open(dev, O_RDWR)) < 0) + if ((fd = open(dev, O_RDWR)) < 0) { + syslog(LOG_ERR, "can't open %s", dev); goto bail_out; + } /* * Get the current line attributes, modify only values that are @@ -235,6 +236,7 @@ main(int argc, char *argv[]) if (!nodaemon && daemon(0, 0)) errx(1, "can't daemonize"); + syslog(LOG_INFO, "attach %s on %s", disc, dev); signal(SIGHUP, coroner); signal(SIGTERM, coroner); |