]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
some C sdk bug fixes + Mac OS X support
authoridgay <idgay>
Wed, 6 Jun 2007 16:17:42 +0000 (16:17 +0000)
committeridgay <idgay>
Wed, 6 Jun 2007 16:17:42 +0000 (16:17 +0000)
support/sdk/c/autoconf.h
support/sdk/c/serialsource.c
support/sdk/c/sf.c

index 6c207b1f07419078cf441e9f446640f480c3d175..8285508389ff369269605597dededc61cf40755b 100644 (file)
@@ -1,4 +1,4 @@
-/* autoconf.h.  Generated by configure.  */
+/* autoconf.h.  Generated from autoconf.h.in by configure.  */
 /* autoconf.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Name of package */
index 5f777f30e432adcae68c7f9f61155b30b8e5c3fd..1b892b79557df489f7d274fd5dba3d23703216d8 100644 (file)
@@ -193,7 +193,9 @@ static void message(serial_source src, serial_source_msg msg)
 }
 
 /* Work around buggy usb serial driver (returns 0 when no data is
-   available, independent of the blocking/non-blocking mode) */
+   available, independent of the blocking/non-blocking mode).
+   Mac OS X seems to like to do this too (at least with a Keyspan 49WG)
+*/
 static int buggyread(serial_source src, void *buffer, int n)
 {
   fd_set fds;
@@ -206,7 +208,6 @@ static int buggyread(serial_source src, void *buffer, int n)
        {
          cnt = -1;
          errno = EAGAIN;
-         printf("foo\n");
        }
       return cnt;
     }
@@ -590,6 +591,7 @@ static void read_and_process(serial_source src)
          else
            {
              message(src, msg_bad_crc);
+             free(received);
              /* We don't lose sync here. If we did, garbage on the line
                 at startup will cause loss of the first packet. */
              continue;
index b104c7d64b6227c4fe34762344416e4bc49b11eb..ada9bc5b4613ba2eec63f5742d452f1fe54c9f2b 100644 (file)
@@ -87,6 +87,7 @@ void rem_client(struct client_list **c)
 
 void new_client(int fd)
 {
+  fcntl(fd, F_SETFL, 0);
   if (init_sf_source(fd) < 0)
     close(fd);
   else