[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/6] ios: Check ios->handler_normalize for memory allocation
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH 3/6] ios: Check ios->handler_normalize for memory allocation error. |
Date: |
Fri, 08 May 2020 00:08:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Why would be want to check for `errno' after calling handler_normalize?
> The function does not return any error code.
handler_normalize returns a new handler which is a newly allocated
string. Therefore, checking for errors is reasonable. Maybe we should
change the signature, tough. If it wrote the new handler to a pointer
we give it to, for example, we could reserve the return value for NULL
for success and error_no for failure.
Yeah, changing the interface of the function to return error codes
sounds like the right thing to do.
We can introduce an IOK_OK code in ios-dev.h for that purpose.
[PATCH 4/6] poke: Add new function pk_assert_alloc, Tim Rühsen, 2020/05/07
[PATCH 5/6] poke: Remove unneeded header includes., Tim Rühsen, 2020/05/07
[PATCH 6/6] ios: Amend OOM message to be consistent everywhere., Tim Rühsen, 2020/05/07