* errno is set to a negative value in lib/tar.c
@ 2023-10-02 17:36 Erik Sjölund
2023-10-05 18:43 ` Gao Xiang
0 siblings, 1 reply; 3+ messages in thread
From: Erik Sjölund @ 2023-10-02 17:36 UTC (permalink / raw)
To: linux-erofs
Hi,
Does this patch make sense?
(I thought errno should be set to a non-negative value)
Best regards,
Erik Sjölund
diff --git a/lib/tar.c b/lib/tar.c
index 0744972..8204939 100644
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -241,7 +241,7 @@ static long long tarerofs_otoi(const char *ptr, int len)
val = strtol(ptr, &endp, 8);
if ((!val && endp == inp) |
(*endp && *endp != ' '))
- errno = -EINVAL;
+ errno = EINVAL;
return val;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: errno is set to a negative value in lib/tar.c
2023-10-02 17:36 errno is set to a negative value in lib/tar.c Erik Sjölund
@ 2023-10-05 18:43 ` Gao Xiang
2023-10-08 0:09 ` Gao Xiang
0 siblings, 1 reply; 3+ messages in thread
From: Gao Xiang @ 2023-10-05 18:43 UTC (permalink / raw)
To: Erik Sjölund; +Cc: linux-erofs
Hi Erik,
On Mon, Oct 02, 2023 at 07:36:08PM +0200, Erik Sjölund wrote:
> Hi,
> Does this patch make sense?
> (I thought errno should be set to a non-negative value)
> Best regards,
> Erik Sjölund
Thanks for the patch.
I'm on vacation, sorry for late reply. It looks good to me,
I will address it when I'm back.
Thanks,
Gao Xiang
>
> diff --git a/lib/tar.c b/lib/tar.c
> index 0744972..8204939 100644
> --- a/lib/tar.c
> +++ b/lib/tar.c
> @@ -241,7 +241,7 @@ static long long tarerofs_otoi(const char *ptr, int len)
> val = strtol(ptr, &endp, 8);
> if ((!val && endp == inp) |
> (*endp && *endp != ' '))
> - errno = -EINVAL;
> + errno = EINVAL;
> return val;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: errno is set to a negative value in lib/tar.c
2023-10-05 18:43 ` Gao Xiang
@ 2023-10-08 0:09 ` Gao Xiang
0 siblings, 0 replies; 3+ messages in thread
From: Gao Xiang @ 2023-10-08 0:09 UTC (permalink / raw)
To: Erik Sjölund, linux-erofs
On 2023/10/6 02:43, Gao Xiang wrote:
> Hi Erik,
>
> On Mon, Oct 02, 2023 at 07:36:08PM +0200, Erik Sjölund wrote:
>> Hi,
>> Does this patch make sense?
>> (I thought errno should be set to a non-negative value)
>> Best regards,
>> Erik Sjölund
>
> Thanks for the patch.
>
> I'm on vacation, sorry for late reply. It looks good to me,
> I will address it when I'm back.
Since this is a one-line patch, I've applied this to -dev
directly. But in principle we need a proper Signed-off-by
tag at least..
Thanks,
Gao Xiang
>
> Thanks,
> Gao Xiang
>
>>
>> diff --git a/lib/tar.c b/lib/tar.c
>> index 0744972..8204939 100644
>> --- a/lib/tar.c
>> +++ b/lib/tar.c
>> @@ -241,7 +241,7 @@ static long long tarerofs_otoi(const char *ptr, int len)
>> val = strtol(ptr, &endp, 8);
>> if ((!val && endp == inp) |
>> (*endp && *endp != ' '))
>> - errno = -EINVAL;
>> + errno = EINVAL;
>> return val;
>> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-08 0:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 17:36 errno is set to a negative value in lib/tar.c Erik Sjölund
2023-10-05 18:43 ` Gao Xiang
2023-10-08 0:09 ` Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.