From 6a425c9566fe20f471ae934b76f8e27be28d1f5b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 4 May 2010 11:11:02 +0300 Subject: [PATCH] obexd: Fix error code when removing non-empty directory The spec clearly state that the error should be Precondition Failed when removing non-empty directory is not supported. The error in this case can be ENOTEMPTY or EEXIST as the rmdir man page says: "pathname contains entries other than . and .. ; or, pathname has .. as its final component. POSIX.1-2001 also allows EEXIST for this condition." --- obexd/src/obex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 6d11af065..a2c7346ff 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -95,6 +95,11 @@ static void os_set_response(obex_object_t *obj, int err) rsp = OBEX_RSP_NOT_IMPLEMENTED; lastrsp = OBEX_RSP_NOT_IMPLEMENTED; break; + case -ENOTEMPTY: + case -EEXIST: + rsp = OBEX_RSP_PRECONDITION_FAILED; + lastrsp = OBEX_RSP_PRECONDITION_FAILED; + break; default: rsp = OBEX_RSP_INTERNAL_SERVER_ERROR; lastrsp = OBEX_RSP_INTERNAL_SERVER_ERROR; -- 2.47.3