aboutsummaryrefslogtreecommitdiffstats
path: root/net/rp-pppoe/files/patch-src::pppoe-sniff.c
blob: 7ff9ce55208c24bad64ad229d58e7faee68ee479 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- src/pppoe-sniff.c.orig	Thu Mar 22 14:35:59 2001
+++ src/pppoe-sniff.c	Thu Mar 22 14:49:39 2001
@@ -33,6 +33,9 @@
 void dlokack(int fd, char *bufp);
 #endif
 
+/* function prototype */
+void sysErr(char const *);
+
 /* Default interface if no -I option given */
 #define DEFAULT_IF "eth0"
 
@@ -43,6 +46,23 @@
 
 char *IfName = NULL;		/* Interface name */
 char *ServiceName = NULL;	/* Service name   */
+
+/**********************************************************************
+*%FUNCTION: sysErr
+*%ARGUMENTS:
+* str -- error message
+*%RETURNS:
+* Nothing
+*%DESCRIPTION:
+* Prints a message plus the errno value to syslog.
+***********************************************************************/
+void
+sysErr(char const *str)
+{
+    char buf[1024];
+    sprintf(buf, "%.256s: %.256s", str, strerror(errno));
+    printErr(buf);
+}
 
 /**********************************************************************
 *%FUNCTION: parsePADRTags