aboutsummaryrefslogtreecommitdiffstats
path: root/isdn.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2000-08-10 09:44:09 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2000-08-10 09:44:09 +0000
commit994c3f1ff0c2b7ab62cfa413827ab17667805aa5 (patch)
tree58f94e3a69cee7187c02a77f19890b99e0910cfc /isdn.c
parent0cb72bf49d0a0decda8285f8fa5a559bffa9e118 (diff)
downloadlcd4linux-994c3f1ff0c2b7ab62cfa413827ab17667805aa5.tar.gz
[lcd4linux @ 2000-08-10 09:44:09 by reinelt]
new debugging scheme: error(), info(), debug() uses syslog if in daemon mode git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@64 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r--isdn.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/isdn.c b/isdn.c
index d19f5b7..4879b55 100644
--- a/isdn.c
+++ b/isdn.c
@@ -1,4 +1,4 @@
-/* $Id: isdn.c,v 1.6 2000/04/15 11:56:35 reinelt Exp $
+/* $Id: isdn.c,v 1.7 2000/08/10 09:44:09 reinelt Exp $
*
* ISDN specific functions
*
@@ -20,6 +20,11 @@
*
*
* $Log: isdn.c,v $
+ * Revision 1.7 2000/08/10 09:44:09 reinelt
+ *
+ * new debugging scheme: error(), info(), debug()
+ * uses syslog if in daemon mode
+ *
* Revision 1.6 2000/04/15 11:56:35 reinelt
*
* more debug messages
@@ -83,25 +88,25 @@ static int Usage (void)
fd=open ("/dev/isdninfo", O_RDONLY | O_NDELAY);
if (fd==-1) {
- perror ("open(/dev/isdninfo) failed");
+ error ("open(/dev/isdninfo) failed: %s", strerror(errno));
return 0;
}
if (read (fd, buffer, sizeof(buffer))==-1) {
- perror ("read(/dev/isdninfo) failed");
+ error ("read(/dev/isdninfo) failed: %s", strerror(errno));
fd=-1;
return 0;
}
if (close(fd)==-1) {
- perror ("close(/dev/isdninfo) failed");
+ error ("close(/dev/isdninfo) failed: %s", strerror(errno));
fd=-1;
return 0;
}
p=strstr(buffer, "usage:");
if (p==NULL) {
- fprintf (stderr, "parse(/dev/isdninfo) failed: no usage line\n");
+ error ("parse(/dev/isdninfo) failed: no usage line");
fd=-1;
return 0;
}
@@ -130,14 +135,14 @@ int Isdn (int *rx, int *tx, int *usage)
if (fd==-2) {
fd = open("/dev/isdninfo", O_RDONLY | O_NDELAY);
if (fd==-1) {
- perror ("open(/dev/isdninfo) failed");
+ error ("open(/dev/isdninfo) failed: %s", strerror(errno));
return -1;
}
- debug ("open (/proc/isdninfo)=%d\n", fd);
+ debug ("open (/proc/isdninfo)=%d", fd);
}
if (ioctl(fd, IIOCGETCPS, &cps)) {
- perror("ioctl(IIOCGETCPS) failed");
+ error("ioctl(IIOCGETCPS) failed: %s", strerror(errno));
fd=-1;
return -1;
}