summaryrefslogtreecommitdiff
path: root/omapip
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2015-09-12 19:21:18 +0200
committerFrancis Dupont <fdupont@isc.org>2015-09-12 19:21:18 +0200
commit713cfd126d317afc545317c61623fc8aedcc7dbf (patch)
tree1b4ace3c7bba0912006e5e14d24cfe84f3b24dda /omapip
parentfc2d5bc8561a99d9269cac7b60bb14bfdecc06a9 (diff)
downloadisc-dhcp-713cfd126d317afc545317c61623fc8aedcc7dbf.tar.gz
Merged #38692 (use program base name in (sys)log)
Diffstat (limited to 'omapip')
-rw-r--r--omapip/errwarn.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/omapip/errwarn.c b/omapip/errwarn.c
index d68af04a..b1d770e2 100644
--- a/omapip/errwarn.c
+++ b/omapip/errwarn.c
@@ -4,7 +4,8 @@
/*
* Copyright (c) 1995 RadioMail Corporation.
- * Copyright (c) 2004,2007,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2014-2015 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -35,6 +36,7 @@
#include <omapip/omapip_p.h>
#include <errno.h>
+#include <string.h>
#include <syslog.h>
#ifdef DEBUG
@@ -361,3 +363,25 @@ char *pWSAError ()
return "Unknown WinSock error";
}
#endif /* _WIN32 */
+
+/* From bind9 libisc */
+
+#ifndef _WIN32
+#define ISC_PATH_SEPARATOR '/'
+#else
+#defineISC_PATH_SEPARATOR '\\'
+#endif
+
+const char *
+isc_file_basename(const char *filename) {
+ char *s;
+
+ if (filename == NULL)
+ return (filename);
+
+ s = strrchr(filename, ISC_PATH_SEPARATOR);
+ if (s == NULL)
+ return (filename);
+
+ return (s + 1);
+}