linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] obex: Fix checking incorrect error code
@ 2013-12-03 16:04 Andrei Emeltchenko
  2013-12-09  8:03 ` Andrei Emeltchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Emeltchenko @ 2013-12-03 16:04 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

chdir return -1 if error and 0 in success. Checking for > 0 is pointless.
---
 tools/obex-server-tool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
index e37c56f..86c2271 100644
--- a/tools/obex-server-tool.c
+++ b/tools/obex-server-tool.c
@@ -427,7 +427,7 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	if (option_root && chdir(option_root) > 0) {
+	if (option_root && chdir(option_root) < 0) {
 		perror("chdir:");
 		exit(EXIT_FAILURE);
 	}
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] obex: Fix checking incorrect error code
  2013-12-03 16:04 [PATCH] obex: Fix checking incorrect error code Andrei Emeltchenko
@ 2013-12-09  8:03 ` Andrei Emeltchenko
  2013-12-09  9:56   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Emeltchenko @ 2013-12-09  8:03 UTC (permalink / raw)
  To: linux-bluetooth

ping

On Tue, Dec 03, 2013 at 06:04:54PM +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> chdir return -1 if error and 0 in success. Checking for > 0 is pointless.
> ---
>  tools/obex-server-tool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
> index e37c56f..86c2271 100644
> --- a/tools/obex-server-tool.c
> +++ b/tools/obex-server-tool.c
> @@ -427,7 +427,7 @@ int main(int argc, char *argv[])
>  		exit(EXIT_FAILURE);
>  	}
>  
> -	if (option_root && chdir(option_root) > 0) {
> +	if (option_root && chdir(option_root) < 0) {
>  		perror("chdir:");
>  		exit(EXIT_FAILURE);
>  	}
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] obex: Fix checking incorrect error code
  2013-12-09  8:03 ` Andrei Emeltchenko
@ 2013-12-09  9:56   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2013-12-09  9:56 UTC (permalink / raw)
  To: Andrei Emeltchenko, linux-bluetooth@vger.kernel.org

Hi Andrei,

On Mon, Dec 9, 2013 at 10:03 AM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@gmail.com> wrote:
> ping
>
> On Tue, Dec 03, 2013 at 06:04:54PM +0200, Andrei Emeltchenko wrote:
>> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>>
>> chdir return -1 if error and 0 in success. Checking for > 0 is pointless.
>> ---
>>  tools/obex-server-tool.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
>> index e37c56f..86c2271 100644
>> --- a/tools/obex-server-tool.c
>> +++ b/tools/obex-server-tool.c
>> @@ -427,7 +427,7 @@ int main(int argc, char *argv[])
>>               exit(EXIT_FAILURE);
>>       }
>>
>> -     if (option_root && chdir(option_root) > 0) {
>> +     if (option_root && chdir(option_root) < 0) {
>>               perror("chdir:");
>>               exit(EXIT_FAILURE);
>>       }
>> --
>> 1.8.3.2

Pushed, thanks.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-09  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03 16:04 [PATCH] obex: Fix checking incorrect error code Andrei Emeltchenko
2013-12-09  8:03 ` Andrei Emeltchenko
2013-12-09  9:56   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).