X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/a99c4e9a49364934a3f74f003507477b9840acb2..3900d6d655918df285b875887aa304666db0f63e:/disobedience/rtp.c?ds=inline
diff --git a/disobedience/rtp.c b/disobedience/rtp.c
index a4efed5..f5f91f0 100644
--- a/disobedience/rtp.c
+++ b/disobedience/rtp.c
@@ -2,30 +2,31 @@
* This file is part of Disobedience
* Copyright (C) 2007 Richard Kettlewell
*
- * This program is free software; you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * along with this program. If not, see .
*/
/** @file disobedience/rtp.c
* @brief RTP player support for Disobedience
*/
#include "disobedience.h"
+#include
#include
#include
#include
#include
+#include
+#include
/** @brief Path to RTP player's control socket */
static char *rtp_socket;
@@ -37,12 +38,17 @@ static char *rtp_log;
static void rtp_init(void) {
if(!rtp_socket) {
const char *home = getenv("HOME");
- char *dir;
+ char *dir, *base;
+ struct utsname uts;
- byte_xasprintf(&dir, "%s/.disorder", home);
+ byte_xasprintf(&dir, "%s/.disorder/", home);
mkdir(dir, 02700);
- byte_xasprintf(&rtp_socket, "%s/rtp", dir);
- byte_xasprintf(&rtp_log, "%s/rtp.log", dir);
+ if(uname(&uts) < 0)
+ byte_xasprintf(&base, "%s/", dir);
+ else
+ byte_xasprintf(&base, "%s/%s-", dir, uts.nodename);
+ byte_xasprintf(&rtp_socket, "%srtp", base);
+ byte_xasprintf(&rtp_log, "%srtp.log", base);
}
}