summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 005e4027..2d5ff5e2 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 4.2 2015/08/29 12:11:20 kls Exp $
+ * $Id: tools.c 4.3 2015/09/06 10:47:05 kls Exp $
*/
#include "tools.h"
@@ -1322,6 +1322,20 @@ uchar *RgbToJpeg(uchar *Mem, int Width, int Height, int &Size, int Quality)
return jcd.mem;
}
+// --- GetHostName -----------------------------------------------------------
+
+const char *GetHostName(void)
+{
+ static char buffer[HOST_NAME_MAX] = "";
+ if (!*buffer) {
+ if (gethostname(buffer, sizeof(buffer)) < 0) {
+ LOG_ERROR;
+ strcpy(buffer, "vdr");
+ }
+ }
+ return buffer;
+}
+
// --- cBase64Encoder --------------------------------------------------------
const char *cBase64Encoder::b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";