From: Luiz Augusto von Dentz <[email protected]>
make[3]: Entering directory `/home/vudentz/git/openobex/apps/ircp'
CC ircp_server.o
CC ircp_client.o
ircp_server.c: In function ‘ircp_srv_receive’:
ircp_server.c:303:1: error: ISO C90 forbids mixed declarations and code
ircp_server.c: In function ‘ircp_srv_recv’:
ircp_server.c:346:6: error: variable ‘err’ set but not used
ircp_server.c: In function ‘ircp_srv_receive’:
ircp_server.c:369:1: error: expected declaration or statement at end of input
ircp_server.c:369:1: error: control reaches end of non-void function
cc1: all warnings being treated as errors
---
apps/ircp/ircp_client.c | 5 +++++
apps/ircp/ircp_server.c | 11 +++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/apps/ircp/ircp_client.c b/apps/ircp/ircp_client.c
index 7f10d0c..1acd4a8 100644
--- a/apps/ircp/ircp_client.c
+++ b/apps/ircp/ircp_client.c
@@ -395,6 +395,11 @@ int ircp_put(ircp_client_t *cli, char *name)
char *dirname;
err = chdir(name);
+ if (err < 0) {
+ perror("chdir:");
+ return -1;
+ }
+
name = ".";
/* Get real name of new wd, extract last part of and do setpath
to it */
diff --git a/apps/ircp/ircp_server.c b/apps/ircp/ircp_server.c
index 08de942..749a84e 100644
--- a/apps/ircp/ircp_server.c
+++ b/apps/ircp/ircp_server.c
@@ -285,8 +285,13 @@ int ircp_srv_receive(ircp_server_t *srv, obex_object_t
*object, int finished)
srv->infocb(IRCP_EV_OK, "");
}
else {
- if(srv->fd > 0)
+ if(srv->fd > 0) {
len = write(srv->fd, body, body_len);
+ if (len < 0) {
+ perror("write:");
+ return -1;
+ }
+ }
}
return 1;
}
@@ -360,6 +365,8 @@ int ircp_srv_recv(ircp_server_t *srv, char *inbox)
/* Go back to inbox */
err = chdir(inbox);
-
+ if (err < 0)
+ perror("chdir:");
+
return ret;
}
--
1.7.5.1
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users