Re: [hackers] [sbase][PATCH] ls: abort a directory if we cannot opendir it

2017-08-22 Thread Hiltjo Posthuma
On Tue, Aug 22, 2017 at 04:51:37PM +1200, David Phillips wrote: > We should not try and perform operations on an invalid DIR* stream. > Instead, we shall let the error message be printed, and the return > code set (existing behaviour) and abort afterwards. > --- > ls.c | 1 + > 1 file changed, 1

Re: [hackers] [sbase][PATCH] ls: abort a directory if we cannot opendir it

2017-08-22 Thread Quentin Rameau
> Sorry, I should have made the commit message clearer. It is > not the entire operation that is being aborted, but only the > current node, if it cannot be opened. Ah, right! > Before this patch, ls will segfault since it tries to perform > operations on a (null) DIR*. After this patch, it

Re: [hackers] [sbase][PATCH] ls: abort a directory if we cannot opendir it

2017-08-22 Thread David Phillips
Sorry, I should have made the commit message clearer. It is not the entire operation that is being aborted, but only the current node, if it cannot be opened. Before this patch, ls will segfault since it tries to perform operations on a (null) DIR*. After this patch, it prints the message, sets

Re: [hackers] [sbase][PATCH] ls: abort a directory if we cannot opendir it

2017-08-22 Thread Quentin Rameau
Hello David, > We should not try and perform operations on an invalid DIR* stream. > Instead, we shall let the error message be printed, and the return > code set (existing behaviour) and abort afterwards. Any justification you could provide us with? AFAIK POSIX specifies the opposite, a