#include "version.h"
#include "voicetarget.h"
+extern char system_string[], version_string[];
+
static int Client_read(client_t *client);
static int Client_write(client_t *client);
static int Client_send_udp(client_t *client, uint8_t *data, int len);
sendmsg->payload.version->has_version = true;
sendmsg->payload.version->version = PROTOCOL_VERSION;
sendmsg->payload.version->release = strdup(UMURMUR_VERSION);
- /* XXX - set OS to something relevant? */
- /* sendmsg->payload.version->os = strdup("Linux/OpenWRT"); */
-
+ sendmsg->payload.version->os = strdup(system_string);
+ sendmsg->payload.version->os_version = strdup(version_string);
Client_send_message(newclient, sendmsg);
return 0;
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
#include <fcntl.h>
#include <signal.h>
#include <sched.h>
#include "conf.h"
#include "version.h"
+char system_string[64], version_string[64];
+
void lockfile(const char *pidfile)
{
int lfp;
bool_t realtime = false;
char *conffile = NULL, *pidfile = NULL;
int c;
+ struct utsname utsbuf;
/* Arguments */
while ((c = getopt(argc, argv, "drp:c:h")) != EOF) {
signal(SIGTTIN, SIG_IGN);
signal(SIGHUP, signal_handler); /* catch hangup signal */
signal(SIGTERM, signal_handler); /* catch kill signal */
-
+
+ /* Build system string */
+ if (uname(&utsbuf) == 0) {
+ snprintf(system_string, 64, "%s %s", utsbuf.sysname, utsbuf.machine);
+ snprintf(version_string, 64, "%s", utsbuf.release);
+ }
+ else {
+ snprintf(system_string, 64, "unknown unknown");
+ snprintf(version_string, 64, "unknown");
+ }
+
/* Initializing */
SSL_init();
Chan_init();