Index: apps/obex_io.c
===================================================================
RCS file: /cvsroot/openobex/openobex/apps/obex_io.c,v
retrieving revision 1.14
diff -u -5 -r1.14 obex_io.c
--- apps/obex_io.c	16 May 2006 13:30:24 -0000	1.14
+++ apps/obex_io.c	24 Jun 2007 04:12:43 -0000
@@ -33,14 +33,11 @@
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
 
-#ifdef _WIN32
-#include <io.h>
-#include <windows.h>
-#else
+#ifndef _WIN32
 #include <sys/stat.h>
 #include <unistd.h>
 #endif /*_WIN32 */
 
 #include <fcntl.h>
@@ -60,11 +57,11 @@
 int get_filesize(const char *filename)
 {
 #ifdef _WIN32
 	HANDLE fh;
 	int size;
-	fh = CreateFile(filename, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+	fh = CreateFileA(filename, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
 	if(fh == INVALID_HANDLE_VALUE) {
 		printf("Cannot open %s\n", filename);
 		return -1;	
 	}
 	size = GetFileSize(fh, NULL);
Index: apps/obex_test.c
===================================================================
RCS file: /cvsroot/openobex/openobex/apps/obex_test.c,v
retrieving revision 1.34
diff -u -5 -r1.34 obex_test.c
--- apps/obex_test.c	2 Jun 2007 05:25:32 -0000	1.34
+++ apps/obex_test.c	24 Jun 2007 04:12:45 -0000
@@ -28,21 +28,21 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 
 #if _WIN32
 #include <winsock2.h>
 #else
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <netinet/in.h>
+#include <unistd.h>
 #endif /* _WIN32 */
 
 #ifdef HAVE_BLUETOOTH
 #ifdef HAVE_BLUETOOTH_LINUX
 #include <bluetooth/bluetooth.h>
Index: apps/obex_test_cable.c
===================================================================
RCS file: /cvsroot/openobex/openobex/apps/obex_test_cable.c,v
retrieving revision 1.21
diff -u -5 -r1.21 obex_test_cable.c
--- apps/obex_test_cable.c	18 Jan 2006 13:02:14 -0000	1.21
+++ apps/obex_test_cable.c	24 Jun 2007 04:12:48 -0000
@@ -32,12 +32,10 @@
 #include <config.h>
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 #include <termios.h>
Index: apps/obex_test_client.c
===================================================================
RCS file: /cvsroot/openobex/openobex/apps/obex_test_client.c,v
retrieving revision 1.18
diff -u -5 -r1.18 obex_test_client.c
--- apps/obex_test_client.c	28 Aug 2006 14:23:53 -0000	1.18
+++ apps/obex_test_client.c	24 Jun 2007 04:12:49 -0000
@@ -29,13 +29,15 @@
 #include <config.h>
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef _WIN32
 #include <unistd.h>
-#include <fcntl.h>
 #include <libgen.h>
+#endif
+#include <fcntl.h>
 #include <string.h>
 
 #include <openobex/obex.h>
 
 #include "obex_io.h"
@@ -208,11 +210,23 @@
 	}
 
 	return actual;
 }
 
-	
+#ifdef _WIN32
+char *basename(char *path)
+{
+	char ptr;
+
+	ptr = strrchr(path, '\\');
+
+	if (ptr == NULL)
+		return path;
+
+	return ptr+1;	
+}
+#endif
 
 void push_client(obex_t *handle)
 {
 	obex_object_t *object;
 
@@ -227,10 +241,11 @@
 	uint8_t *buf;
 	int file_size;
 
 	printf("PUSH filename> ");
 	num = scanf("%s", fname);
+
 	bfname = strdup(basename(fname));
 
 	buf = easy_readfile(fname, &file_size);
 	if(buf == NULL) {
 	        printf("file not found: %s\n", fname);
Index: apps/obex_test_server.c
===================================================================
RCS file: /cvsroot/openobex/openobex/apps/obex_test_server.c,v
retrieving revision 1.12
diff -u -5 -r1.12 obex_test_server.c
--- apps/obex_test_server.c	16 May 2006 13:26:15 -0000	1.12
+++ apps/obex_test_server.c	24 Jun 2007 04:12:54 -0000
@@ -249,11 +249,10 @@
 		if(ret < 0) {
 			printf("Error while doing OBEX_HandleInput()\n");
 			break;
 		} else if (ret == 0) {
 			printf("Timeout while doing OBEX_HandleInput()\n");
-			break;
 		} else {
 			printf("OBEX_HandleInput() returned %d\n",ret);
 		}
 	}
 }
