Diff between 799f6ff793250bbc692964d000429549803528a1 and 96ffb02e2b4dd45a8b35b19b27776a1ce89d1ee0

Changed Files

File Additions Deletions Status
obexd/client/transfer.c +9 -3 modified
obexd/plugins/pcsuite.c +3 -1 modified
obexd/src/main.c +3 -1 modified

Full Patch

diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 744d8f1..dccce03 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -420,8 +420,11 @@ static void obc_transfer_free(struct obc_transfer *transfer)
 
 	if (transfer->op == G_OBEX_OP_GET &&
 				transfer->status != TRANSFER_STATUS_COMPLETE &&
-				transfer->filename)
-		remove(transfer->filename);
+				transfer->filename) {
+		if (remove(transfer->filename) < 0)
+			error("remove(%s): %s(%d)", transfer->filename,
+							strerror(errno), errno);
+	}
 
 	if (transfer->fd > 0)
 		close(transfer->fd);
@@ -521,7 +524,10 @@ static gboolean transfer_open(struct obc_transfer *transfer, int flags,
 	}
 
 	if (transfer->filename == NULL) {
-		remove(filename); /* remove always only if NULL was given */
+		/* remove always only if NULL was given */
+		if (remove(filename) < 0)
+			error("remove(%s): %s(%d)", filename, strerror(errno),
+									errno);
 		g_free(filename);
 	} else {
 		g_free(transfer->filename);
diff --git a/obexd/plugins/pcsuite.c b/obexd/plugins/pcsuite.c
index b2232ea..f5a9d9a 100644
--- a/obexd/plugins/pcsuite.c
+++ b/obexd/plugins/pcsuite.c
@@ -219,7 +219,9 @@ static void pcsuite_disconnect(struct obex_session *os, void *user_data)
 		close(pcsuite->fd);
 
 	if (pcsuite->lock_file) {
-		remove(pcsuite->lock_file);
+		if (remove(pcsuite->lock_file) < 0)
+			error("remove(%s): %s(%d)", pcsuite->lock_file,
+							strerror(errno), errno);
 		g_free(pcsuite->lock_file);
 	}
 
diff --git a/obexd/src/main.c b/obexd/src/main.c
index 04284c9..d950883 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -270,7 +270,9 @@ int main(int argc, char *argv[])
 	if (option_root == NULL) {
 		option_root = g_build_filename(g_get_user_cache_dir(), "obexd",
 									NULL);
-		g_mkdir_with_parents(option_root, 0700);
+		if (g_mkdir_with_parents(option_root, 0700) < 0)
+			error("Failed to create dir(%d): %s", errno,
+								option_root);
 	}
 
 	if (option_root[0] != '/') {