91 lines
1.9 KiB
Text
91 lines
1.9 KiB
Text
$NetBSD: patch-ai,v 1.3 2009/07/20 05:56:03 hasso Exp $
|
|
|
|
--- apps/obexftpd.c.orig 2006-04-13 07:57:55.000000000 +0200
|
|
+++ apps/obexftpd.c
|
|
@@ -23,6 +23,10 @@
|
|
* Created at: Don, 2 Okt 2003
|
|
*/
|
|
|
|
+#ifdef HAVE_CONFIG_H
|
|
+#include <config.h>
|
|
+#endif
|
|
+
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -45,6 +49,14 @@
|
|
#include <netdb.h>
|
|
#endif /*_WIN32*/
|
|
|
|
+#ifdef HAVE_BLUETOOTH
|
|
+#if defined(__NetBSD__) || defined(__DragonFly__)
|
|
+#include <bluetooth.h>
|
|
+#else
|
|
+#include <bluetooth/bluetooth.h>
|
|
+#endif
|
|
+#endif /* HAVE_BLUETOOTH */
|
|
+
|
|
/* just until there is a server layer in obexftp */
|
|
#include <openobex/obex.h>
|
|
|
|
@@ -934,16 +946,21 @@ static void start_server(int transport)
|
|
exit(0);
|
|
}
|
|
|
|
- if (transport==OBEX_TRANS_BLUETOOTH && 0 > obexftp_sdp_register())
|
|
- {
|
|
- //OBEX_Cleanup(handle);
|
|
- fprintf(stderr, "register to SDP Server failed.\n");
|
|
- exit(0);
|
|
- }
|
|
- else
|
|
- {
|
|
- use_sdp = 1;
|
|
- }
|
|
+#ifdef HAVE_BLUETOOTH
|
|
+ if (transport==OBEX_TRANS_BLUETOOTH)
|
|
+ {
|
|
+ if (0 > obexftp_sdp_register())
|
|
+ {
|
|
+ //OBEX_Cleanup(handle);
|
|
+ fprintf(stderr, "register to SDP Server failed.\n");
|
|
+ exit(0);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ use_sdp = 1;
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
|
|
reset:
|
|
handle = OBEX_Init(transport, obex_event, 0);
|
|
@@ -963,12 +980,14 @@ reset:
|
|
exit(-1);
|
|
}
|
|
break;
|
|
+#ifdef HAVE_BLUETOOTH
|
|
case OBEX_TRANS_BLUETOOTH:
|
|
if (0 > BtOBEX_ServerRegister(handle, bt_src, channel)) {
|
|
perror("failed to register bluetooth server");
|
|
exit(-1);
|
|
}
|
|
break;
|
|
+#endif
|
|
case OBEX_TRANS_IRDA:
|
|
if (0 > IrOBEX_ServerRegister(handle, "")) {
|
|
perror("failed to register IrDA server");
|
|
@@ -1002,11 +1021,13 @@ reset:
|
|
goto reset;
|
|
}
|
|
|
|
+#ifdef HAVE_BLUETOOTH
|
|
if (use_sdp)
|
|
{
|
|
fprintf(stderr, "sdp unregister\n");
|
|
obexftp_sdp_unregister();
|
|
}
|
|
+#endif
|
|
|
|
}
|
|
|