Use err(3). Add usage()s.

This commit is contained in:
Philippe Charnier 1997-10-06 11:36:08 +00:00
parent 39245839f5
commit 9dd6fd23cd
15 changed files with 207 additions and 157 deletions

View File

@ -22,14 +22,19 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
@ -91,10 +96,8 @@ xmalloc(int sz)
p = malloc(sz);
if (p)
bzero(p, sz);
else {
perror("malloc");
exit(1);
}
else
errx(1, "malloc");
return (p);
}

View File

@ -22,20 +22,25 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
#include <pccard/cis.h>
void usage();
static void usage __P((char *));
int
enabler_main(argc, argv)
@ -54,12 +59,12 @@ enabler_main(argc, argv)
usage("arg count");
slot = atoi(argv[1]);
if (slot < 0 || slot >= MAXSLOT)
usage("Illegal slot number");
usage("illegal slot number");
p = argv[2];
while (*p && (*p < '0' || *p > '9'))
p++;
if (*p == 0)
usage("No unit on device name");
usage("no unit on device name");
drv.unit = atoi(p);
*p = 0;
strcpy(drv.name, argv[2]);
@ -68,25 +73,25 @@ enabler_main(argc, argv)
while (argc > 1) {
if (strcmp(argv[0], "-m") == 0) {
if (argc < 4)
usage("Memory argument error");
usage("memory argument error");
if (sscanf(argv[1], "%x", &card_addr) != 1)
usage("Bad card address");
usage("bad card address");
if (sscanf(argv[2], "%lx", &drv.mem) != 1)
usage("Bad memory address");
usage("bad memory address");
if (sscanf(argv[3], "%d", &i) != 1)
usage("Bad memory size");
usage("bad memory size");
drv.memsize = i * 1024;
argc -= 2;
argv += 2;
} else if (strcmp(argv[0], "-f") == 0) {
if (sscanf(argv[1], "%x", &drv.flags) != 1)
usage("Bad driver flags");
usage("bad driver flags");
} else if (strcmp(argv[0], "-a") == 0) {
if (sscanf(argv[1], "%x", &drv.iobase) != 1)
usage("Bad I/O address");
usage("bad I/O address");
} else if (strcmp(argv[0], "-i") == 0) {
if (sscanf(argv[1], "%d", &i) != 1 || i < 1 || i > 15)
usage("Illegal IRQ");
usage("illegal IRQ");
drv.irqmask = 1 << i;
}
argc -= 2;
@ -99,10 +104,8 @@ enabler_main(argc, argv)
drv.irqmask, drv.flags);
sprintf(name, CARD_DEVICE, slot);
fd = open(name, 2);
if (fd < 0) {
perror(name);
exit(1);
}
if (fd < 0)
err(1, "%s", name);
/* Map the memory and I/O contexts. */
if (drv.mem) {
@ -111,23 +114,19 @@ enabler_main(argc, argv)
mem.start = (caddr_t)drv.mem;
mem.size = drv.memsize;
mem.card = card_addr;
if (ioctl(fd, PIOCSMEM, &mem)) {
perror("Set memory context");
exit(1);
}
if (ioctl(fd, PIOCSMEM, &mem))
err(1, "set memory context");
}
if (drv.iobase) {
io.window = 0;
io.flags = IODF_ACTIVE | IODF_CS16;
io.start = drv.iobase;
io.size = 32; /* Blah... */
if (ioctl(fd, PIOCSIO, &io)) {
perror("Set I/O context");
exit(1);
}
if (ioctl(fd, PIOCSIO, &io))
err(1, "set I/O context");
}
if (ioctl(fd, PIOCSDRV, &drv))
perror("set driver");
warn("set driver");
close(fd);
return 0;
}
@ -139,16 +138,16 @@ void
usage(msg)
char *msg;
{
fprintf(stderr, "enabler: %s\n", msg);
warnx("enabler: %s", msg);
fprintf(stderr,
"Usage: enabler slot driver [ -m addr size ] [ -a iobase ] [ -i irq ]\n");
"usage: pccardc enabler slot driver [-m addr size] [-a iobase] [-i irq]\n");
fprintf(stderr,
" -m card addr size : Card address (hex), host address (hex) & size (Kb)\n");
" -m card addr size : card address (hex), host address (hex) & size (Kb)\n");
fprintf(stderr,
" -a iobase : I/O port address (hex)\n");
" -a iobase : I/O port address (hex)\n");
fprintf(stderr,
" -i irq : Interrupt request number (1-15)\n");
" -i irq : interrupt request number (1-15)\n");
fprintf(stderr,
" Example: enabler 0 ed0 -m 2000 d4000 16 -a 300 -i 3\n");
" Example: enabler 0 ed0 -m 2000 d4000 16 -a 300 -i 3\n");
exit(1);
}

View File

@ -22,9 +22,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
@ -68,7 +73,7 @@ main(int argc, char **argv)
}
}
if (argc > 1)
fprintf(stderr, "Unknown Subcommand.\n");
warnx("unknown subcommand");
return help_main(argc, argv);
}
@ -77,9 +82,8 @@ help_main(int argc, char **argv)
{
int i;
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\t%s <subcommand> <arg> ...\n", argv[0]);
fprintf(stderr, "Subcommands:\n");
fprintf(stderr, "usage: pccardc <subcommand> <arg> ...\n");
fprintf(stderr, "subcommands:\n");
for (i = 0; subcommands[i].name; i++)
fprintf(stderr, "\t%s\n\t\t%s\n",
subcommands[i].name, subcommands[i].help);

View File

@ -22,16 +22,28 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#include <stdio.h>
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
static void
usage()
{
fprintf(stderr, "usage: pccardc pccardmem [memory-address]\n");
exit(1);
}
int
pccardmem_main(argc, argv)
int argc;
@ -41,24 +53,18 @@ pccardmem_main(argc, argv)
int addr = 0;
int fd;
if (argc > 2) {
fprintf(stderr, "usage: %s [ memory-address ]\n", argv[0]);
exit(1);
}
if (argc > 2)
usage();
sprintf(name, CARD_DEVICE, 0);
fd = open(name, 0);
if (fd < 0) {
perror(name);
exit(1);
}
if (fd < 0)
err(1, "%s", name);
if (argc == 2) {
if (sscanf(argv[1], "%x", &addr) != 1) {
fprintf(stderr, "arg error\n");
exit(1);
}
if (sscanf(argv[1], "%x", &addr) != 1)
errx(1, "arg error");
}
if (ioctl(fd, PIOCRWMEM, &addr))
perror("ioctl");
warn("ioctl");
else
printf("PCCARD Memory address set to 0x%x\n", addr);
exit(0);

View File

@ -22,13 +22,17 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pccard/card.h>

View File

@ -22,14 +22,18 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pccard/card.h>

View File

@ -22,13 +22,18 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
@ -44,13 +49,13 @@ dumpslot(sl)
sprintf(name, CARD_DEVICE, sl);
fd = open(name, 2);
if (fd < 0) {
perror(name);
warn("%s", name);
return;
}
printf("Registers for slot %d\n", sl);
for (r.reg = 0; r.reg < 0x40; r.reg++) {
if (ioctl(fd, PIOCGREG, &r)) {
perror("ioctl");
warn("ioctl");
break;
}
if ((r.reg % 16) == 0)

View File

@ -22,18 +22,30 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
static void
usage()
{
fprintf(stderr, "usage: pccardc wrattr slot offs value\n");
exit(1);
}
int
wrattr_main(argc, argv)
int argc;
@ -44,30 +56,22 @@ wrattr_main(argc, argv)
int fd;
off_t offs;
if (argc != 4) {
fprintf(stderr, "usage: %s wrattr slot offs value\n", argv[0]);
exit(1);
}
if (argc != 4)
usage();
sprintf(name, CARD_DEVICE, atoi(argv[1]));
fd = open(name, 2);
if (fd < 0) {
perror(name);
exit(1);
}
if (fd < 0)
err(1, "%s", name);
reg = MDF_ATTR;
if (ioctl(fd, PIOCRWFLAG, &reg)) {
perror("ioctl (PIOCRWFLAG)");
exit(1);
}
if (ioctl(fd, PIOCRWFLAG, &reg))
err(1, "ioctl (PIOCRWFLAG)");
if (sscanf(argv[2], "%x", &reg) != 1 ||
sscanf(argv[3], "%x", &value) != 1) {
fprintf(stderr, "arg error\n");
exit(1);
}
sscanf(argv[3], "%x", &value) != 1)
errx(1, "arg error");
offs = reg;
c = value;
lseek(fd, offs, SEEK_SET);
if (write(fd, &c, 1) != 1)
perror(name);
warn("%s", name);
return 0;
}

View File

@ -22,18 +22,30 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
static void
usage()
{
fprintf(stderr, "usage: pccardc wrreg slot reg value\n");
exit(1);
}
int
wrreg_main(argc, argv)
int argc;
@ -44,24 +56,18 @@ wrreg_main(argc, argv)
int fd;
struct pcic_reg r;
if (argc != 4) {
fprintf(stderr, "usage: wrreg slot reg value\n");
exit(1);
}
if (argc != 4)
usage();
sprintf(name, CARD_DEVICE, atoi(argv[1]));
fd = open(name, 2);
if (fd < 0) {
perror(name);
exit(1);
}
if (fd < 0)
err(1, "%s", name);
if (sscanf(argv[2], "%x", &reg) != 1 ||
sscanf(argv[3], "%x", &value) != 1) {
fprintf(stderr, "arg error\n");
exit(1);
}
sscanf(argv[3], "%x", &value) != 1)
errx(1, "arg error");
r.reg = reg;
r.value = value;
if (ioctl(fd, PIOCSREG, &r))
perror("ioctl");
warn("ioctl");
return 0;
}

View File

@ -22,15 +22,18 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
@ -59,8 +62,6 @@ main(int argc, char *argv[])
struct slot *sp;
int count, debug = 0;
int verbose = 0;
extern char *optarg;
extern int optind, optopt;
while ((count = getopt(argc, argv, ":dvf:")) != -1) {
switch (count) {
@ -76,10 +77,10 @@ main(int argc, char *argv[])
config_file = optarg;
break;
case ':':
die("No config file argument");
die("no config file argument");
break;
case '?':
die("Illegal option");
die("illegal option");
break;
}
}
@ -99,7 +100,7 @@ main(int argc, char *argv[])
die("fork failed");
readslots();
if (slots == 0)
die("No PC-CARD slots");
die("no PC-CARD slots");
log_1s("pccardd started", NULL);
for (;;) {
fd_set mask;
@ -108,7 +109,7 @@ main(int argc, char *argv[])
FD_SET(sp->fd, &mask);
count = select(32, 0, 0, &mask, 0);
if (count == -1) {
logerr("Select");
logerr("select");
continue;
}
if (count)
@ -187,7 +188,7 @@ readslots(void)
if (mem == 0) {
mem = alloc_memory(4 * 1024);
if (mem == 0)
die("Can't allocate memory for controller access");
die("can't allocate memory for controller access");
if (ioctl(fd, PIOCRWMEM, &mem))
logerr("ioctl (PIOCRWMEM)");
}

View File

@ -22,9 +22,13 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -146,7 +150,7 @@ parsefile(void)
parse_card();
break;
default:
error("Syntax error");
error("syntax error");
pusht = 0;
break;
}
@ -177,7 +181,7 @@ parse_card(void)
/* config */
i = num_tok();
if (i == -1) {
error("Illegal card config index");
error("illegal card config index");
break;
}
confp = xmalloc(sizeof(*confp));
@ -190,7 +194,7 @@ parse_card(void)
confp->flags = 0;
}
if (confp->irq < 0 || confp->irq > 15) {
error("Illegal card IRQ value");
error("illegal card IRQ value");
break;
}
confp->index = i & 0x3F;
@ -214,7 +218,7 @@ parse_card(void)
/* reset */
i = num_tok();
if (i == -1) {
error("Illegal card reset time");
error("illegal card reset time");
break;
}
cp->reset_time = i;
@ -223,7 +227,7 @@ parse_card(void)
/* ether */
cp->ether = num_tok();
if (cp->ether == -1) {
error("Illegal ether address offset");
error("illegal ether address offset");
cp->ether = 0;
}
break;
@ -303,7 +307,7 @@ ioblk_tok(int force)
return (io);
}
if (force)
error("Illegal or missing I/O block spec");
error("illegal or missing I/O block spec");
return (0);
}
@ -318,13 +322,13 @@ memblk_tok(int force)
if ((i = num_tok()) >= 0)
if ((j = num_tok()) < 0)
error("Illegal memory block");
error("illegal memory block");
else {
mem = xmalloc(sizeof(*mem));
mem->addr = i & ~(MEMUNIT - 1);
mem->size = (j + MEMUNIT - 1) & ~(MEMUNIT - 1);
if (i < MEMSTART || (i + j) > MEMEND) {
error("Memory address out of range");
error("memory address out of range");
if (force) {
free(mem);
mem = 0;
@ -334,7 +338,7 @@ memblk_tok(int force)
return (mem);
}
if (force)
error("Illegal or missing memory block spec");
error("illegal or missing memory block spec");
return (0);
}
@ -354,7 +358,7 @@ irq_tok(int force)
if (i > 0 && i < 16)
return (i);
if (force)
error("Illegal IRQ value");
error("illegal IRQ value");
return (-1);
}
@ -557,7 +561,7 @@ _next_tok(void)
break;
case '\n':
if (instr) {
error("Unterminated string");
error("unterminated string");
break;
}
case ' ':

View File

@ -33,7 +33,7 @@
configuration file
.Sh DESCRIPTION
The
.Nm pccard.conf
.Nm
file is the configuration file for the
.Xr pccardd 8
PC-CARD slot management daemon.

View File

@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $Id$
.\" $Id: pccardd.8,v 1.7 1997/02/22 16:08:58 peter Exp $
.\"
.Dd November 1, 1994
.Dt PCCARD 8
@ -42,7 +42,7 @@ is normally started at boot time, and manages the insertion
and removal of PC-CARD cards.
.Pp
When started,
.Nm pccardd
.Nm
will read the configuration file (default name
.Pa /etc/pccard.conf )
and scans the available PC-CARD slots for cards.
@ -69,7 +69,7 @@ the card description in the configuration file.
Once matched, a driver is allocated.
.It
Once a free driver and device instance is located,
.Nm pccardd
.Nm
will (if required) allocate resources such as an ISA memory
block and Input/Output ports from a common pool.
.It
@ -85,7 +85,7 @@ for each card, driver or device, and are executed in that order.
.El
.Pp
When
.Nm pccardd
.Nm
detects that a card has been removed, the following sequence occurs:
.Bl -enum
.It
@ -110,7 +110,7 @@ parameters. This will change significantly when loadable kernel
modules are supported.
.Pp
The start options understood by
.Nm pccardd
.Nm
are:
.Bl -tag -width Ds
.It Fl d
@ -122,7 +122,7 @@ of it.
.It Fl f Ar configfile
Specifies a different configuration file to be used
in placed of the default file
.Pa /etc/pccard.conf.
.Pa /etc/pccard.conf .
The file format is detailed in
.Xr card.conf 5 ,
and lists the PC-CARD cards recognized by
@ -138,7 +138,8 @@ interface to the card.
.Xr pccard.conf 5 ,
.Xr ifconfig 8
.Sh AUTHOR
Developed by Andrew McRae (andrew@mega.com.au).
Developed by
.An Andrew McRae Aq andrew@mega.com.au .
.Sh BUGS
.Nm Pccardd
can set up card parameters, but cannot guarantee that

View File

@ -22,13 +22,18 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <pccard/card.h>
@ -478,7 +483,7 @@ read_one_tuplelist(int fd, int flags, off_t offs)
lseek(fd, offs, SEEK_SET);
do {
if (read_attr(fd, &code, 1) != 1) {
perror("CIS code read");
warn("CIS code read");
break;
}
total++;
@ -487,7 +492,7 @@ read_one_tuplelist(int fd, int flags, off_t offs)
tp = xmalloc(sizeof(*tp));
tp->code = code;
if (read_attr(fd, &length, 1) != 1) {
perror("CIS len read");
warn("CIS len read");
break;
}
total++;
@ -503,7 +508,7 @@ read_one_tuplelist(int fd, int flags, off_t offs)
total += length;
tp->data = xmalloc(length);
if (read_attr(fd, tp->data, length) != length) {
perror("CIS read");
warn("CIS read");
break;
}
}

View File

@ -22,8 +22,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
*
* $Id$
*/
/*
@ -33,12 +31,18 @@
* Nate Williams <nate@FreeBSD.org>
*/
#ifndef lint
static const char rcsid[] =
"$Id$";
#endif /* not lint */
#include <err.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <syslog.h>
@ -74,7 +78,7 @@ log_1s(const char *fmt, ...)
dialog_clear();
msgConfirm(s);
#else
fprintf(stderr, "cardd: %s\n", s);
warnx("%s", s);
#endif
}
}
@ -89,7 +93,7 @@ logerr(char *msg)
dialog_clear();
msgConfirm(msg);
#else
perror(msg);
warn("%s", msg);
#endif
}
}
@ -110,7 +114,7 @@ die(char *msg)
dialog_clear();
msgConfirm(s);
#else
fprintf(stderr, "cardd fatal error: %s\n", msg);
warnx("fatal error: %s", msg);
#endif
}
closelog();