Marcelo wrote:
On Tue, Mar 3, 2009 at 6:24 AM, michael <[email protected]> wrote:
$ patch -p1 -d . --dry-run <
~/0001-Adjust-the-gps-code-and-semplify-it.-Remove-the-mute.patch
patching file gps_freerunner.c
Hunk #5 FAILED at 1018.
Hunk #6 FAILED at 1055.
Hunk #7 FAILED at 1219.
3 out of 7 hunks FAILED -- saving rejects to file gps_freerunner.c.rej

Can you please sync against current HEAD and send again?

Marcelo
_______________________________________________
android-freerunner mailing list
[email protected]
http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org


>From 57e81ddf19b47ef1337e68249ad14cbbe588c982 Mon Sep 17 00:00:00 2001
From: Michael Trimarchi <[email protected]>
Date: Tue, 3 Mar 2009 14:40:33 +0100
Subject: [PATCH] Adjust the gps code and semplify it.
 Deadlock reason: If the engine is "set on" the Navigation is active and
 the EventThread can't be stopped.

---
 gps_freerunner.c |   23 +++++------------------
 1 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/gps_freerunner.c b/gps_freerunner.c
index d2de6ff..a907345 100644
--- a/gps_freerunner.c
+++ b/gps_freerunner.c
@@ -919,8 +919,6 @@ gps_state_thread( void*  arg )
 
     gps_dev_init(gps_fd);
 
-    GPS_STATUS_CB(state->callbacks, GPS_STATUS_ENGINE_ON); 
-
     // now loop
     for (;;) {
         struct epoll_event   events[2];
@@ -993,20 +991,11 @@ gps_state_thread( void*  arg )
                 }
                 else if (fd == gps_fd)
                 {
-                    char  buff[32];
-                    D("gps fd event");
-                    for (;;) {
-                        int  nn, ret;
-
-                        ret = read( fd, buff, sizeof(buff) );
-                        if (ret < 0) {
-                            if (errno == EINTR)
-                                continue;
-                            if (errno != EWOULDBLOCK)
-                                LOGE("error while reading from gps daemon socket: %s:", strerror(errno));
-                            break;
-                        }
-                        D("received %d bytes: %.*s", ret, ret, buff);
+                    char  buff[512];
+                    int  nn, ret;
+
+                    ret = read( fd, buff, sizeof(buff) );
+                    if (ret > 0)
                         for (nn = 0; nn < ret; nn++)
                             nmea_reader_addc( reader, buff[nn] );
                     }
@@ -1023,8 +1012,6 @@ Exit:
 
     gps_dev_deinit(gps_fd);
 
-    GPS_STATUS_CB(state->callbacks, GPS_STATUS_ENGINE_OFF);
-
     return NULL;
 }
 
-- 
1.5.6.5

_______________________________________________
android-freerunner mailing list
[email protected]
http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org

Reply via email to