Diff between 97c6683e9503cd3528739aedae007337ccde80f8 and fc180e2f74d6e05af95234c900d88f35a358cfd5

Changed Files

File Additions Deletions Status
obexd/client/session.c +10 -10 modified
obexd/client/transfer.c +2 -2 modified
obexd/plugins/bluetooth.c +6 -6 modified
obexd/plugins/filesystem.c +1 -1 modified
obexd/plugins/ftp.c +7 -7 modified
obexd/plugins/nokia-backup.c +15 -16 modified
obexd/plugins/pbap.c +1 -1 modified
obexd/plugins/phonebook-dummy.c +3 -3 modified
obexd/plugins/syncevolution.c +1 -1 modified
obexd/plugins/usb.c +3 -3 modified
obexd/src/main.c +1 -1 modified
obexd/src/manager.c +4 -4 modified
obexd/src/mimetype.c +2 -2 modified
obexd/src/obex.c +27 -27 modified
obexd/src/plugin.c +4 -4 modified
obexd/src/server.c +3 -3 modified
obexd/src/service.c +2 -2 modified
obexd/src/transport.c +2 -2 modified

Full Patch

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 2db482b..596daab 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -90,7 +90,7 @@ struct session_data *session_ref(struct session_data *session)
 {
 	g_atomic_int_inc(&session->refcount);
 
-	debug("session_ref(%p): ref=%d", session, session->refcount);
+	DBG("%p: ref=%d", session, session->refcount);
 
 	return session;
 }
@@ -156,12 +156,12 @@ static void session_unregistered(struct session_data *session)
 	g_dbus_unregister_interface(session->conn, session->path,
 					SESSION_INTERFACE);
 
-	debug("Session(%p) unregistered %s", session, session->path);
+	DBG("Session(%p) unregistered %s", session, session->path);
 }
 
 static void session_free(struct session_data *session)
 {
-	debug("session_free(%p)", session);
+	DBG("%p", session);
 
 	if (session->agent)
 		agent_release(session);
@@ -194,7 +194,7 @@ void session_unref(struct session_data *session)
 
 	ret = g_atomic_int_dec_and_test(&session->refcount);
 
-	debug("session_unref(%p): ref=%d", session, session->refcount);
+	DBG("%p: ref=%d", session, session->refcount);
 
 	if (ret == FALSE)
 		return;
@@ -520,7 +520,7 @@ void session_shutdown(struct session_data *session)
 {
 	struct transfer_data *transfer;
 
-	debug("session_shutdown(%p)", session);
+	DBG("%p", session);
 	transfer = session->pending ? session->pending->data : NULL;
 
 	session_ref(session);
@@ -819,7 +819,7 @@ static void session_request_reply(DBusPendingCall *call, gpointer user_data)
 			DBUS_TYPE_STRING, &name,
 			DBUS_TYPE_INVALID);
 
-	debug("Agent.Request() reply: %s", name);
+	DBG("Agent.Request() reply: %s", name);
 
 	if (strlen(name)) {
 		g_free(pending->transfer->name);
@@ -870,7 +870,7 @@ static int session_request(struct session_data *session, session_callback_t cb,
 
 	dbus_pending_call_set_notify(call, session_request_reply, session, NULL);
 
-	debug("Agent.Request(\"%s\")", transfer->path);
+	DBG("Agent.Request(\"%s\")", transfer->path);
 
 	return 0;
 }
@@ -920,7 +920,7 @@ static void session_notify_complete(struct session_data *session,
 
 done:
 
-	debug("Transfer(%p) complete", transfer);
+	DBG("Transfer(%p) complete", transfer);
 
 	session_terminate_transfer(session, transfer);
 }
@@ -1003,7 +1003,7 @@ static void session_notify_progress(struct session_data *session,
 	g_dbus_send_message(session->conn, message);
 
 done:
-	debug("Transfer(%p) progress: %ld bytes", transfer,
+	DBG("Transfer(%p) progress: %ld bytes", transfer,
 			(long int ) transferred);
 
 	if (transferred == transfer->size)
@@ -1331,7 +1331,7 @@ int session_register(struct session_data *session)
 		return -EIO;
 	}
 
-	debug("Session(%p) registered %s", session, session->path);
+	DBG("Session(%p) registered %s", session, session->path);
 
 	return 0;
 }
diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index dc585dc..373e4e4 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -200,7 +200,7 @@ struct transfer_data *transfer_register(struct session_data *session,
 		return NULL;
 	}
 
-	debug("Transfer(%p) registered %s", transfer, transfer->path);
+	DBG("Transfer(%p) registered %s", transfer, transfer->path);
 
 done:
 	session->pending = g_slist_append(session->pending, transfer);
@@ -216,7 +216,7 @@ void transfer_unregister(struct transfer_data *transfer)
 		g_dbus_unregister_interface(session->conn,
 			transfer->path, TRANSFER_INTERFACE);
 
-		debug("Transfer(%p) unregistered %s", transfer,
+		DBG("Transfer(%p) unregistered %s", transfer,
 					transfer->path);
 	}
 
diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index ae4ca8d..851daa2 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
@@ -91,7 +91,7 @@ static void add_record_reply(DBusPendingCall *call, void *user_data)
 
 		service->handle = handle;
 
-		debug("bluetooth: Registered: %s, handle: 0x%x",
+		DBG("Registered: %s, handle: 0x%x",
 				service->driver->name, service->handle);
 	}
 
@@ -223,7 +223,7 @@ static DBusPendingCall *find_adapter(const char *pattern,
 	DBusMessage *msg;
 	DBusPendingCall *call;
 
-	debug("bluetooth: FindAdapter(%s)", pattern);
+	DBG("FindAdapter(%s)", pattern);
 
 	msg = dbus_message_new_method_call("org.bluez", "/",
 					"org.bluez.Manager", "FindAdapter");
@@ -332,7 +332,7 @@ static void service_reply(DBusPendingCall *call, void *user_data)
 		goto done;
 	}
 
-	debug("bluetooth: RequestAuthorization succeeded");
+	DBG("RequestAuthorization succeeded");
 
 	if (!bt_io_accept(io, connect_event, service, NULL, &err)) {
 		error("%s", err->message);
@@ -381,7 +381,7 @@ static void find_adapter_reply(DBusPendingCall *call, void *user_data)
 			DBUS_TYPE_OBJECT_PATH, &path,
 			DBUS_TYPE_INVALID);
 
-	debug("bluetooth: FindAdapter -> %s", path);
+	DBG("FindAdapter -> %s", path);
 	pending->adapter_path = g_strdup(path);
 	dbus_message_unref(reply);
 
@@ -400,7 +400,7 @@ static void find_adapter_reply(DBusPendingCall *call, void *user_data)
 
 	dbus_message_unref(msg);
 
-	debug("bluetooth: RequestAuthorization(%s, %x)", paddr,
+	DBG("RequestAuthorization(%s, %x)", paddr,
 			pending->service->handle);
 
 	if (!dbus_pending_call_set_notify(pcall, service_reply, pending,
@@ -519,7 +519,7 @@ static GIOChannel *start(struct obex_server *server,
 				service->channel, err->message);
 		g_error_free(err);
 	} else
-		debug("bluetooth: listening on channel %d", service->channel);
+		DBG("listening on channel %d", service->channel);
 
 	return io;
 }
diff --git a/obexd/plugins/filesystem.c b/obexd/plugins/filesystem.c
index adbf6d6..6c860cb 100644
--- a/obexd/plugins/filesystem.c
+++ b/obexd/plugins/filesystem.c
@@ -399,7 +399,7 @@ static GString *append_listing(GString *object, const char *name,
 			ret = lstat(fullname, &fstat);
 
 		if (ret < 0) {
-			debug("%s: %s(%d)", root ? "stat" : "lstat",
+			DBG("%s: %s(%d)", root ? "stat" : "lstat",
 					strerror(errno), errno);
 			g_free(filename);
 			g_free(fullname);
diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c
index 24553e5..007fe4a 100644
--- a/obexd/plugins/ftp.c
+++ b/obexd/plugins/ftp.c
@@ -301,7 +301,7 @@ static int ftp_setpath(struct obex_session *os, obex_object_t *obj,
 
 	/* Check flag "Backup" */
 	if ((nonhdr[0] & 0x01) == 0x01) {
-		debug("Set to parent path");
+		DBG("Set to parent path");
 
 		if (root)
 			return -EPERM;
@@ -310,18 +310,18 @@ static int ftp_setpath(struct obex_session *os, obex_object_t *obj,
 		set_folder(ftp, fullname);
 		g_free(fullname);
 
-		debug("Set to parent path: %s", ftp->folder);
+		DBG("Set to parent path: %s", ftp->folder);
 
 		return 0;
 	}
 
 	if (!name) {
-		debug("Set path failed: name missing!");
+		DBG("Set path failed: name missing!");
 		return -EINVAL;
 	}
 
 	if (strlen(name) == 0) {
-		debug("Set to root");
+		DBG("Set to root");
 		set_folder(ftp, root_folder);
 		return 0;
 	}
@@ -334,7 +334,7 @@ static int ftp_setpath(struct obex_session *os, obex_object_t *obj,
 
 	fullname = g_build_filename(ftp->folder, name, NULL);
 
-	debug("Fullname: %s", fullname);
+	DBG("Fullname: %s", fullname);
 
 	if (root && obex_get_symlinks(os))
 		err = stat(fullname, &dstat);
@@ -347,7 +347,7 @@ static int ftp_setpath(struct obex_session *os, obex_object_t *obj,
 		if (err == -ENOENT)
 			goto not_found;
 
-		debug("%s: %s(%d)", root ? "stat" : "lstat",
+		DBG("%s: %s(%d)", root ? "stat" : "lstat",
 				strerror(-err), -err);
 
 		goto done;
@@ -370,7 +370,7 @@ not_found:
 
 	if (mkdir(fullname, 0755) <  0) {
 		err = -errno;
-		debug("mkdir: %s(%d)", strerror(-err), -err);
+		DBG("mkdir: %s(%d)", strerror(-err), -err);
 		goto done;
 	}
 
diff --git a/obexd/plugins/nokia-backup.c b/obexd/plugins/nokia-backup.c
index 2b590b6..8865271 100644
--- a/obexd/plugins/nokia-backup.c
+++ b/obexd/plugins/nokia-backup.c
@@ -79,7 +79,7 @@ static void on_backup_dbus_notify(DBusPendingCall *pending_call,
 	const char *filename;
 	int error_code;
 
-	debug("backup: Notification received for pending call - %s", obj->cmd);
+	DBG("Notification received for pending call - %s", obj->cmd);
 
 	reply = dbus_pending_call_steal_reply(pending_call);
 
@@ -90,15 +90,14 @@ static void on_backup_dbus_notify(DBusPendingCall *pending_call,
 		obj->error_code = error_code;
 
 		if (filename) {
-			debug("backup: Notification - file path = %s,"
-					"error_code = %d", filename,
-					error_code);
+			DBG("Notification - file path = %s, error_code = %d",
+					filename, error_code);
 			if (error_code == 0)
 				obj->fd = open(filename,obj->oflag,obj->mode);
 		}
 
 	} else
-		debug("backup: Notification timed out or connection got closed");
+		DBG("Notification timed out or connection got closed");
 
 	if (reply)
 		dbus_message_unref(reply);
@@ -109,14 +108,14 @@ static void on_backup_dbus_notify(DBusPendingCall *pending_call,
 	obj->conn = NULL;
 
 	if (obj->fd >= 0) {
-		debug("backup: File opened, setting io flags, cmd = %s",
+		DBG("File opened, setting io flags, cmd = %s",
 				obj->cmd);
 		if (obj->oflag == O_RDONLY)
 			obex_object_set_io_flags(user_data, G_IO_IN, 0);
 		else
 			obex_object_set_io_flags(user_data, G_IO_OUT, 0);
 	} else {
-		debug("backup: File open error, setting io error, cmd = %s",
+		DBG("File open error, setting io error, cmd = %s",
 				obj->cmd);
 		obex_object_set_io_flags(user_data, G_IO_ERR, -EPERM);
 	}
@@ -176,7 +175,7 @@ static void *backup_open(const char *name, int oflag, mode_t mode,
 {
 	struct backup_object *obj = g_new0(struct backup_object, 1);
 
-	debug("backup: open(), cmd = %s", name);
+	DBG("cmd = %s", name);
 
 	obj->cmd = g_path_get_basename(name);
 	obj->oflag = oflag;
@@ -202,7 +201,7 @@ static int backup_close(void *object)
 	struct backup_object *obj = object;
 	size_t size = 0;
 
-	debug("backup: close(), cmd = %s", obj->cmd);
+	DBG("cmd = %s", obj->cmd);
 
 	if (obj->fd != -1)
 		close(obj->fd);
@@ -229,17 +228,17 @@ static ssize_t backup_read(void *object, void *buf, size_t count, uint8_t *hi)
 	*hi = OBEX_HDR_BODY;
 
 	if (obj->pending_call) {
-		debug("backup: read(), cmd = %s, IN WAITING STAGE", obj->cmd);
+		DBG("cmd = %s, IN WAITING STAGE", obj->cmd);
 		return -EAGAIN;
 	}
 
 	if (obj->fd != -1) {
-		debug("backup: read(), cmd = %s, READING DATA", obj->cmd);
+		DBG("cmd = %s, READING DATA", obj->cmd);
 		ret = read(obj->fd, buf, count);
 		if (ret < 0)
 			ret = -errno;
 	} else {
-		debug("backup: read(), cmd = %s, PERMANENT FAILURE", obj->cmd);
+		DBG("cmd = %s, PERMANENT FAILURE", obj->cmd);
 		ret = obj->error_code?(-obj->error_code):(-ENOENT);
 	}
 
@@ -252,21 +251,21 @@ static ssize_t backup_write(void *object, const void *buf, size_t count)
 	ssize_t ret = 0;
 
 	if (obj->pending_call) {
-		debug("backup: write(), cmd = %s, IN WAITING STAGE", obj->cmd);
+		DBG("cmd = %s, IN WAITING STAGE", obj->cmd);
 		return -EAGAIN;
 	}
 
 	if (obj->fd != -1) {
 		ret = write(obj->fd, buf, count);
 
-		debug("backup: write(), cmd = %s, WRITTING", obj->cmd);
+		DBG("cmd = %s, WRITTING", obj->cmd);
 
 		if (ret < 0) {
-			debug("backup: write() error, cmd = %s", obj->cmd);
+			error("backup: cmd = %s", obj->cmd);
 			ret = -errno;
 		}
 	} else {
-		debug("backup: write() error, cmd = %s", obj->cmd);
+		error("backup: cmd = %s", obj->cmd);
 		ret = obj->error_code ? -obj->error_code : -ENOENT;
 	}
 
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c
index 32f5ef3..b598c68 100644
--- a/obexd/plugins/pbap.c
+++ b/obexd/plugins/pbap.c
@@ -431,7 +431,7 @@ static void cache_entry_done(void *user_data)
 
 	id = cache_find(&pbap->cache, pbap->find_handle);
 	if (id == NULL) {
-		debug("Entry %d not found on cache", pbap->find_handle);
+		DBG("Entry %d not found on cache", pbap->find_handle);
 		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
 		return;
 	}
diff --git a/obexd/plugins/phonebook-dummy.c b/obexd/plugins/phonebook-dummy.c
index 6f3a7d4..1c0135e 100644
--- a/obexd/plugins/phonebook-dummy.c
+++ b/obexd/plugins/phonebook-dummy.c
@@ -221,7 +221,7 @@ static gboolean read_dir(void *user_data)
 	dp = opendir(dummy->folder);
 	if (dp == NULL) {
 		int err = errno;
-		debug("opendir(): %s(%d)", strerror(err), err);
+		DBG("opendir(): %s(%d)", strerror(err), err);
 		goto done;
 	}
 
@@ -494,7 +494,7 @@ int phonebook_get_entry(const char *folder, const char *id,
 	fd = open(filename, O_RDONLY);
 	if (fd < 0) {
 		int err = errno;
-		debug("open(): %s(%d)", strerror(err), err);
+		DBG("open(): %s(%d)", strerror(err), err);
 		return -ENOENT;
 	}
 
@@ -522,7 +522,7 @@ int phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb,
 
 	if (dp == NULL) {
 		int err = errno;
-		debug("opendir(): %s(%d)", strerror(err), err);
+		DBG("opendir(): %s(%d)", strerror(err), err);
 		return -ENOENT;
 	}
 
diff --git a/obexd/plugins/syncevolution.c b/obexd/plugins/syncevolution.c
index bdc4446..55709df 100644
--- a/obexd/plugins/syncevolution.c
+++ b/obexd/plugins/syncevolution.c
@@ -170,7 +170,7 @@ static void connect_cb(DBusPendingCall *call, void *user_data)
 		goto failed;
 	}
 
-	debug("Got conn object %s from syncevolution", path);
+	DBG("Got conn object %s from syncevolution", path);
 	context->conn_obj = g_strdup(path);
 
 	context->reply_watch = g_dbus_add_signal_watch(conn, NULL, path,
diff --git a/obexd/plugins/usb.c b/obexd/plugins/usb.c
index 779532d..949e94f 100644
--- a/obexd/plugins/usb.c
+++ b/obexd/plugins/usb.c
@@ -78,14 +78,14 @@ static void usb_disconnect(struct obex_server *server)
 	g_io_channel_shutdown(usb_io, TRUE, NULL);
 	g_io_channel_unref(usb_io);
 	usb_io = NULL;
-	debug("usb: disconnected");
+	DBG("disconnected");
 }
 
 static gboolean usb_reconnect(void *data)
 {
 	struct obex_server *server = data;
 
-	debug("usb: reconnecting");
+	DBG("reconnecting");
 	usb_reconnecting = 0;
 	usb_connect(server);
 
@@ -156,7 +156,7 @@ static int usb_connect(struct obex_server *server)
 	usb_watch = g_io_add_watch(usb_io, G_IO_HUP | G_IO_ERR | G_IO_NVAL,
 					usb_watchdog, server);
 
-	debug("usb: Successfully opened %s", USB_DEVNODE);
+	DBG("Successfully opened %s", USB_DEVNODE);
 
 	return 0;
 
diff --git a/obexd/src/main.c b/obexd/src/main.c
index d3ca3b1..b4c0508 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -157,7 +157,7 @@ static gboolean root_folder_setup(char *root, char *root_setup)
 	if (root_setup == NULL)
 		return FALSE;
 
-	debug("Setting up %s using %s", root, root_setup);
+	DBG("Setting up %s using %s", root, root_setup);
 
 	if (!g_spawn_sync(NULL, argv, NULL, 0, NULL, NULL, NULL, NULL,
 							&status, NULL)) {
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index d0fe936..78a329c 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -184,7 +184,7 @@ static void dbus_message_iter_append_dict_entry(DBusMessageIter *dict,
 
 static void agent_disconnected(DBusConnection *conn, void *user_data)
 {
-	debug("Agent exited");
+	DBG("Agent exited");
 	agent_free(agent);
 	agent = NULL;
 }
@@ -210,7 +210,7 @@ static DBusMessage *register_agent(DBusConnection *conn,
 	agent->watch_id = g_dbus_add_disconnect_watch(conn, sender,
 					agent_disconnected, NULL, NULL);
 
-	debug("Agent registered");
+	DBG("Agent registered");
 
 	return dbus_message_new_method_return(msg);
 }
@@ -240,7 +240,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn,
 	agent_free(agent);
 	agent = NULL;
 
-	debug("Agent unregistered");
+	DBG("Agent unregistered");
 
 	return dbus_message_new_method_return(msg);
 }
@@ -491,7 +491,7 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
 				DBUS_TYPE_INVALID)) {
 		/* Splits folder and name */
 		const char *slash = strrchr(name, '/');
-		debug("Agent replied with %s", name);
+		DBG("Agent replied with %s", name);
 		if (!slash) {
 			agent->new_name = g_strdup(name);
 			agent->new_folder = NULL;
diff --git a/obexd/src/mimetype.c b/obexd/src/mimetype.c
index 95a667b..7b96ec2 100644
--- a/obexd/src/mimetype.c
+++ b/obexd/src/mimetype.c
@@ -183,7 +183,7 @@ int obex_mime_type_driver_register(struct obex_mime_type_driver *driver)
 	if (driver->set_io_watch == NULL)
 		driver->set_io_watch = set_io_watch;
 
-	debug("driver %p mimetype %s registered", driver, driver->mimetype);
+	DBG("driver %p mimetype %s registered", driver, driver->mimetype);
 
 	drivers = g_slist_append(drivers, driver);
 
@@ -197,7 +197,7 @@ void obex_mime_type_driver_unregister(struct obex_mime_type_driver *driver)
 		return;
 	}
 
-	debug("driver %p mimetype %s unregistered", driver, driver->mimetype);
+	DBG("driver %p mimetype %s unregistered", driver, driver->mimetype);
 
 	drivers = g_slist_remove(drivers, driver);
 }
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 200bc17..a608ca3 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -296,20 +296,20 @@ static void cmd_connect(struct obex_session *os,
 
 	if (OBEX_ObjectGetNonHdrData(obj, &buffer) != sizeof(*nonhdr)) {
 		OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
-		debug("Invalid OBEX CONNECT packet");
+		DBG("Invalid OBEX CONNECT packet");
 		return;
 	}
 
 	nonhdr = (obex_connect_hdr_t *) buffer;
 	mtu = g_ntohs(nonhdr->mtu);
-	debug("Version: 0x%02x. Flags: 0x%02x  OBEX packet length: %d",
+	DBG("Version: 0x%02x. Flags: 0x%02x  OBEX packet length: %d",
 			nonhdr->version, nonhdr->flags, mtu);
 	/* Leave space for headers */
 	newsize = mtu - 200;
 
 	os->tx_mtu = newsize;
 
-	debug("Resizing stream chunks to %d", newsize);
+	DBG("Resizing stream chunks to %d", newsize);
 
 	/* connection id will be used to track the sessions, even for OPP */
 	os->cid = ++cid;
@@ -326,12 +326,12 @@ static void cmd_connect(struct obex_session *os,
 			break;
 		case OBEX_HDR_AUTHCHAL:
 			if (nonce) {
-				debug("Ignoring multiple challenge headers");
+				DBG("Ignoring multiple challenge headers");
 				break;
 			}
 
 			nonce = extract_nonce(hd.bs, hlen);
-			debug("AUTH CHALLENGE REQUEST");
+			DBG("AUTH CHALLENGE REQUEST");
 			break;
 		}
 	}
@@ -346,7 +346,7 @@ static void cmd_connect(struct obex_session *os,
 		return;
 	}
 
-	debug("Selected driver: %s", os->service->name);
+	DBG("Selected driver: %s", os->service->name);
 
 	if (!os->service->connect) {
 		OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
@@ -446,7 +446,7 @@ static int obex_read_stream(struct obex_session *os, obex_t *obex,
 	memcpy(os->buf + os->pending, buffer, size);
 	os->pending += size;
 	if (os->object == NULL) {
-		debug("Stored %u bytes into temporary buffer", os->pending);
+		DBG("Stored %u bytes into temporary buffer", os->pending);
 		return 0;
 	}
 
@@ -482,7 +482,7 @@ static int obex_write_stream(struct obex_session *os,
 	unsigned int flags;
 	uint8_t hi;
 
-	debug("obex_write_stream: name=%s type=%s tx_mtu=%d file=%p",
+	DBG("obex_write_stream: name=%s type=%s tx_mtu=%d file=%p",
 		os->name ? os->name : "", os->type ? os->type : "",
 		os->tx_mtu, os->object);
 
@@ -605,7 +605,7 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
 		switch (hi) {
 		case OBEX_HDR_NAME:
 			if (os->name) {
-				debug("Ignoring multiple name headers");
+				DBG("Ignoring multiple name headers");
 				break;
 			}
 
@@ -614,11 +614,11 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
 
 			os->name = g_convert((const char *) hd.bs, hlen,
 					"UTF8", "UTF16BE", NULL, NULL, NULL);
-			debug("OBEX_HDR_NAME: %s", os->name);
+			DBG("OBEX_HDR_NAME: %s", os->name);
 			break;
 		case OBEX_HDR_TYPE:
 			if (os->type) {
-				debug("Ignoring multiple type headers");
+				DBG("Ignoring multiple type headers");
 				break;
 			}
 
@@ -630,14 +630,14 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
 				break;
 
 			if (!g_utf8_validate((const char *) hd.bs, -1, NULL)) {
-				debug("Invalid type header: %s", hd.bs);
+				DBG("Invalid type header: %s", hd.bs);
 				break;
 			}
 
 			/* FIXME: x-obex/folder-listing - type is mandatory */
 
 			os->type = g_strndup((const char *) hd.bs, hlen);
-			debug("OBEX_HDR_TYPE: %s", os->type);
+			DBG("OBEX_HDR_TYPE: %s", os->type);
 			os->driver = obex_mime_type_driver_find(
 						os->service->target, os->type,
 						os->service->who,
@@ -719,7 +719,7 @@ static void cmd_setpath(struct obex_session *os,
 			continue;
 
 		if (os->name) {
-			debug("Ignoring multiple name headers");
+			DBG("Ignoring multiple name headers");
 			break;
 		}
 
@@ -733,7 +733,7 @@ static void cmd_setpath(struct obex_session *os,
 		os->name = g_convert((const char *) hd.bs, hlen,
 				"UTF8", "UTF16BE", NULL, NULL, NULL);
 
-		debug("Set path name: %s", os->name);
+		DBG("Set path name: %s", os->name);
 		break;
 	}
 
@@ -786,7 +786,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
 	os->path = g_strdup(filename);
 
 	if (!os->buf) {
-		debug("PUT request checked, no buffered data");
+		DBG("PUT request checked, no buffered data");
 		return 0;
 	}
 
@@ -820,7 +820,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 		switch (hi) {
 		case OBEX_HDR_NAME:
 			if (os->name) {
-				debug("Ignoring multiple name headers");
+				DBG("Ignoring multiple name headers");
 				break;
 			}
 
@@ -829,12 +829,12 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 
 			os->name = g_convert((const char *) hd.bs, hlen,
 					"UTF8", "UTF16BE", NULL, NULL, NULL);
-			debug("OBEX_HDR_NAME: %s", os->name);
+			DBG("OBEX_HDR_NAME: %s", os->name);
 			break;
 
 		case OBEX_HDR_TYPE:
 			if (os->type) {
-				debug("Ignoring multiple type headers");
+				DBG("Ignoring multiple type headers");
 				break;
 			}
 
@@ -846,12 +846,12 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 				break;
 
 			if (!g_utf8_validate((const char *) hd.bs, -1, NULL)) {
-				debug("Invalid type header: %s", hd.bs);
+				DBG("Invalid type header: %s", hd.bs);
 				break;
 			}
 
 			os->type = g_strndup((const char *) hd.bs, hlen);
-			debug("OBEX_HDR_TYPE: %s", os->type);
+			DBG("OBEX_HDR_TYPE: %s", os->type);
 			os->driver = obex_mime_type_driver_find(
 						os->service->target, os->type,
 						os->service->who,
@@ -865,7 +865,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 
 		case OBEX_HDR_LENGTH:
 			os->size = hd.bq4;
-			debug("OBEX_HDR_LENGTH: %d", os->size);
+			DBG("OBEX_HDR_LENGTH: %d", os->size);
 			break;
 		case OBEX_HDR_TIME:
 			os->time = parse_iso8610((const char *) hd.bs, hlen);
@@ -908,7 +908,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 		os->driver->set_io_watch(os->object, handle_async_io, os);
 		return TRUE;
 	default:
-		debug("Unhandled chkput error: %d", ret);
+		DBG("Unhandled chkput error: %d", ret);
 		OBEX_ObjectSetRsp(obj, OBEX_RSP_INTERNAL_SERVER_ERROR,
 				OBEX_RSP_INTERNAL_SERVER_ERROR);
 		return FALSE;
@@ -916,7 +916,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
 	}
 
 	if (os->size == OBJECT_SIZE_DELETE || os->size == OBJECT_SIZE_UNKNOWN) {
-		debug("Got a PUT without a Length");
+		DBG("Got a PUT without a Length");
 		goto done;
 	}
 
@@ -1038,7 +1038,7 @@ static void obex_event(obex_t *obex, obex_object_t *obj, int mode,
 			cmd_put(os, obex, obj);
 			break;
 		default:
-			debug("Unknown request: 0x%X", cmd);
+			DBG("Unknown request: 0x%X", cmd);
 			OBEX_ObjectSetRsp(obj, OBEX_RSP_NOT_IMPLEMENTED,
 						OBEX_RSP_NOT_IMPLEMENTED);
 			break;
@@ -1091,7 +1091,7 @@ static void obex_event(obex_t *obex, obex_object_t *obj, int mode,
 		break;
 
 	default:
-		debug("Unknown evt %d", evt);
+		DBG("Unknown evt %d", evt);
 		break;
 	}
 }
@@ -1187,7 +1187,7 @@ void obex_set_name(struct obex_session *os, const char *name)
 {
 	g_free(os->name);
 	os->name = g_strdup(name);
-	debug("Name changed: %s", os->name);
+	DBG("Name changed: %s", os->name);
 }
 
 ssize_t obex_get_size(struct obex_session *os)
diff --git a/obexd/src/plugin.c b/obexd/src/plugin.c
index a181858..14a569f 100644
--- a/obexd/src/plugin.c
+++ b/obexd/src/plugin.c
@@ -74,7 +74,7 @@ static gboolean add_plugin(void *handle, struct obex_plugin_desc *desc)
 	}
 
 	plugins = g_slist_append(plugins, plugin);
-	debug("Plugin %s loaded", desc->name);
+	DBG("Plugin %s loaded", desc->name);
 
 	return TRUE;
 }
@@ -90,12 +90,12 @@ gboolean plugin_init(void)
 	if (strlen(PLUGINDIR) == 0)
 		return FALSE;
 
-	debug("Loading builtin plugins");
+	DBG("Loading builtin plugins");
 
 	for (i = 0; __obex_builtin[i]; i++)
 		add_plugin(NULL,  __obex_builtin[i]);
 
-	debug("Loading plugins %s", PLUGINDIR);
+	DBG("Loading plugins %s", PLUGINDIR);
 
 	dir = g_dir_open(PLUGINDIR, 0, NULL);
 	if (!dir)
@@ -142,7 +142,7 @@ void plugin_cleanup(void)
 {
 	GSList *list;
 
-	debug("Cleanup plugins");
+	DBG("Cleanup plugins");
 
 	for (list = plugins; list; list = list->next) {
 		struct obex_plugin *plugin = list->data;
diff --git a/obexd/src/server.c b/obexd/src/server.c
index f52be54..54c1b34 100644
--- a/obexd/src/server.c
+++ b/obexd/src/server.c
@@ -65,13 +65,13 @@ int obex_server_init(uint16_t service, const char *folder,
 
 	drivers = obex_service_driver_list(service);
 	if (drivers == NULL) {
-		debug("No service driver registered");
+		DBG("No service driver registered");
 		return -EINVAL;
 	}
 
 	transports = obex_transport_driver_list();
 	if (transports == NULL) {
-		debug("No transport driver registered");
+		DBG("No transport driver registered");
 		return -EINVAL;
 	}
 
@@ -95,7 +95,7 @@ int obex_server_init(uint16_t service, const char *folder,
 
 		server->transport_data = transport->start(server, &err);
 		if (server->transport_data == NULL) {
-			debug("Unable to start %s transport: %s (%d)",
+			DBG("Unable to start %s transport: %s (%d)",
 					transport->name, strerror(err), err);
 			obex_server_free(server);
 			continue;
diff --git a/obexd/src/service.c b/obexd/src/service.c
index 395b8f9..1692a41 100644
--- a/obexd/src/service.c
+++ b/obexd/src/service.c
@@ -87,7 +87,7 @@ int obex_service_driver_register(struct obex_service_driver *driver)
 		return -EPERM;
 	}
 
-	debug("driver %p service %s registered", driver, driver->name);
+	DBG("driver %p service %s registered", driver, driver->name);
 
 	/* Drivers that support who has priority */
 	if (driver->who)
@@ -105,7 +105,7 @@ void obex_service_driver_unregister(struct obex_service_driver *driver)
 		return;
 	}
 
-	debug("driver %p service %s unregistered", driver, driver->name);
+	DBG("driver %p service %s unregistered", driver, driver->name);
 
 	drivers = g_slist_remove(drivers, driver);
 }
diff --git a/obexd/src/transport.c b/obexd/src/transport.c
index 80096b3..6d51f53 100644
--- a/obexd/src/transport.c
+++ b/obexd/src/transport.c
@@ -71,7 +71,7 @@ int obex_transport_driver_register(struct obex_transport_driver *driver)
 		return -EPERM;
 	}
 
-	debug("driver %p transport %s registered", driver, driver->name);
+	DBG("driver %p transport %s registered", driver, driver->name);
 
 	drivers = g_slist_prepend(drivers, driver);
 
@@ -85,7 +85,7 @@ void obex_transport_driver_unregister(struct obex_transport_driver *driver)
 		return;
 	}
 
-	debug("driver %p transport %s unregistered", driver, driver->name);
+	DBG("driver %p transport %s unregistered", driver, driver->name);
 
 	drivers = g_slist_remove(drivers, driver);
 }