aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/uxplay/files/uxplay-0_pre20210525-use-machine-hostname.patch')
-rw-r--r--media-video/uxplay/files/uxplay-0_pre20210525-use-machine-hostname.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/media-video/uxplay/files/uxplay-0_pre20210525-use-machine-hostname.patch b/media-video/uxplay/files/uxplay-0_pre20210525-use-machine-hostname.patch
new file mode 100644
index 000000000..207a0c8e5
--- /dev/null
+++ b/media-video/uxplay/files/uxplay-0_pre20210525-use-machine-hostname.patch
@@ -0,0 +1,49 @@
+From a5098ee748a7c6ba078479a6bffd1cacbb5a538d Mon Sep 17 00:00:00 2001
+From: mrbesen <y.g.2@gmx.de>
+Date: Wed, 10 Mar 2021 12:04:56 +0100
+Subject: [PATCH] use Hostname as default Name
+
+---
+ uxplay.cpp | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/uxplay.cpp b/uxplay.cpp
+index c1e6b8a..b91151d 100755
+--- a/uxplay.cpp
++++ b/uxplay.cpp
+@@ -24,6 +24,7 @@
+ #include <string>
+ #include <vector>
+ #include <fstream>
++#include <sys/utsname.h> // uname(read hostname)
+
+ #include "log.h"
+ #include "lib/raop.h"
+@@ -102,6 +103,18 @@ void print_info(char *name) {
+ printf("-v/-h Displays this help and version information\n");
+ }
+
++/* read the mashines hostname an write it into name */
++void get_hostname(std::string& name) {
++ struct utsname buf;
++ int res = uname(&buf);
++ if(res) {
++ //error
++ printf("could not read hostname: %d %s\n", res, strerror(res));
++ return;
++ }
++ name = buf.nodename;
++}
++
+ int main(int argc, char *argv[]) {
+ init_signals();
+
+@@ -112,6 +125,8 @@ int main(int argc, char *argv[]) {
+ bool low_latency = DEFAULT_LOW_LATENCY;
+ bool debug_log = DEFAULT_DEBUG_LOG;
+
++ get_hostname(server_name);
++
+ // Parse arguments
+ for (int i = 1; i < argc; i++) {
+ std::string arg(argv[i]);