Import Upstream version 1.9.1.0.svn346
This commit is contained in:
1 parent
9404a6167d
commit
9602397440
24 files changed
+134
-247
No files matched your search
+15
-10
@@ -17,7 +17,7 @@
|
||||
|
||||
(c) 2006 Mike Lampard, Philip Lawatsch, and others
|
||||
|
||||
$Revision: 190 $ - $Date: 2006-11-21 17:31:03 +0100 (Tue, 21 Nov 2006) $ $Author: mlampard $
|
||||
$Revision: 339 $ - $Date: 2007-12-15 07:10:26 +0100 (Sat, 15 Dec 2007) $ $Author: mlampard $
|
||||
|
||||
This daemon listens on localhost port 15550 for client connections,
|
||||
and arbitrates LCD display. Allows for multiple simultaneous clients.
|
||||
@@ -195,18 +195,24 @@ void g15daemon_sleep(int seconds) {
|
||||
pthread_mutex_destroy(&dummy_mutex);
|
||||
}
|
||||
|
||||
/* microsecond sleep routine. */
|
||||
int g15daemon_usleep(int useconds) {
|
||||
|
||||
struct timeval timeout;
|
||||
if(useconds < 10000)
|
||||
useconds = 10000;
|
||||
timeout.tv_sec = useconds / 1000000;
|
||||
timeout.tv_usec = useconds % 1000000;
|
||||
return select (0,0,0,0,&timeout);
|
||||
}
|
||||
|
||||
/* millisecond sleep routine. */
|
||||
int g15daemon_msleep(int milliseconds) {
|
||||
|
||||
struct timespec timeout;
|
||||
if(milliseconds>999)
|
||||
milliseconds=999;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_nsec = milliseconds*1000000;
|
||||
|
||||
return nanosleep (&timeout, NULL);
|
||||
return g15daemon_usleep(milliseconds*1000);
|
||||
}
|
||||
|
||||
|
||||
unsigned int g15daemon_gettime_ms(){
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv,NULL);
|
||||
@@ -367,7 +373,6 @@ char * uf_remove_whitespace(char *str){
|
||||
int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){
|
||||
|
||||
config_items_t *new = NULL;
|
||||
const char empty[]=" ";
|
||||
|
||||
if(section==NULL)
|
||||
return -1;
|
||||
@@ -519,7 +524,7 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
|
||||
int config_fd=-1;
|
||||
char *sect;
|
||||
char *start;
|
||||
char *bar;
|
||||
char *bar = NULL;
|
||||
int i;
|
||||
struct stat stats;
|
||||
|
||||
|
||||
Reference in new issue
Block a user