|
From: <mla...@us...> - 2007-09-08 14:07:09
|
Revision: 293
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=293&view=rev
Author: mlampard
Date: 2007-09-08 07:07:12 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
First support for OS-X thanks to Fabrizio.
Modified Paths:
--------------
trunk/g15daemon/AUTHORS
trunk/g15daemon/g15daemon/g15_net.c
trunk/g15daemon/g15daemon/g15daemon.h
trunk/g15daemon/g15daemon/main.c
Modified: trunk/g15daemon/AUTHORS
===================================================================
--- trunk/g15daemon/AUTHORS 2007-09-08 12:06:56 UTC (rev 292)
+++ trunk/g15daemon/AUTHORS 2007-09-08 14:07:12 UTC (rev 293)
@@ -4,4 +4,7 @@
Sven Ludwig
- Python bindings
James Green
-- Documentaion updates
\ No newline at end of file
+- Documentaion updates
+Fabrizio Sestito
+- changes required to compile on OS-X
+- OS-X kext file
Modified: trunk/g15daemon/g15daemon/g15_net.c
===================================================================
--- trunk/g15daemon/g15daemon/g15_net.c 2007-09-08 12:06:56 UTC (rev 292)
+++ trunk/g15daemon/g15daemon/g15_net.c 2007-09-08 14:07:12 UTC (rev 293)
@@ -42,6 +42,10 @@
extern unsigned int client_handles_keys;
extern lcd_t *keyhandler;
+#ifndef SO_PRIORITY
+#define SO_PRIORITY 12
+#endif
+
void send_keystate(lcd_t *client) {
int sock = client->connection;
int msgret;
Modified: trunk/g15daemon/g15daemon/g15daemon.h
===================================================================
--- trunk/g15daemon/g15daemon/g15daemon.h 2007-09-08 12:06:56 UTC (rev 292)
+++ trunk/g15daemon/g15daemon/g15daemon.h 2007-09-08 14:07:12 UTC (rev 293)
@@ -51,6 +51,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include <pthread.h>
#define CLIENT_CMD_GET_KEYSTATE 'k'
#define CLIENT_CMD_SWITCH_PRIORITIES 'p'
Modified: trunk/g15daemon/g15daemon/main.c
===================================================================
--- trunk/g15daemon/g15daemon/main.c 2007-09-08 12:06:56 UTC (rev 292)
+++ trunk/g15daemon/g15daemon/main.c 2007-09-08 14:07:12 UTC (rev 293)
@@ -32,6 +32,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <libdaemon/daemon.h>
@@ -262,6 +263,10 @@
"Unable to create new keyboard thread",
"Unable to create new display thread",
"Unable to create server thread",
+#ifdef OSTYPE_DARWIN
+ "Unable to load USB shield kext",
+ "Unable to launch kextload",
+#endif
NULL };
if((retval = daemon_retval_wait(20)) !=0) {
if(retval)
@@ -294,6 +299,21 @@
if(LIBG15_VERSION>=1200)
libg15Debug(g15daemon_debug);
+#ifdef OSTYPE_DARWIN
+
+ /* OS X: load codeless kext */
+ retval = system("/sbin/kextload " "/System/Library/Extensions/libusbshield.kext");
+
+ if (WIFEXITED(retval)){
+ if (WEXITSTATUS(retval) !=0){
+ daemon_log(LOG_ERR,"Unable to load USB shield kext");
+ daemon_retval_send(8);
+ }
+ } else {
+ daemon_log(LOG_ERR,"Unable to launch kextload");
+ daemon_retval_send(9);
+ }
+#endif
/* init stuff here.. */
retval = initLibG15();
if(retval != G15_NO_ERROR){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|