Closed alejandro-colomar closed 2 months ago
Bogus ruby test.
I'm not sure denying mkdir("", ...);
is really worth worrying about, it just returns ENOENT
... but i'm assuming it would be a simple
if (*dir == '\0')
return NXT_ERROR;
type thing?
I'm not sure denying
mkdir("", ...);
is really worth worrying about, it just returnsENOENT
... but i'm assuming it would be a simpleif (*dir == '\0') return NXT_ERROR;
type thing?
If I remove that assert, the code will return NXT_OK, while mkdir(2) returns an error. I prefer reporting NXT_ERROR for "" (so far, agree with you), which I'll do by transforming the while into a do-while. But I need you to apply the other patches to avoid a conflict in the merge.
So yeah, I have plans for it. :-)
And the do-while would not only not introduce a branch, but it would skip a test in the first iteration.
I'm not sure denying
mkdir("", ...);
is really worth worrying about, it just returnsENOENT
... but i'm assuming it would be a simpleif (*dir == '\0') return NXT_ERROR;
type thing?
If I remove that assert, the code will return NXT_OK, while mkdir(2) returns an error. I prefer reporting NXT_ERROR for "" (so far, agree with you), which I'll do by transforming the while into a do-while. But I need you to apply the other patches to avoid a conflict in the merge.
So yeah, I have plans for it. :-)
And the do-while would not only not introduce a branch, but it would skip a test in the first iteration.
Ahh, no, the +1 won't allow me. Didn't think of it. So yeah, just keep the assert. I drop my plans for "". :)
Closing in favour of https://github.com/nginx/unit/pull/1235
v2 changes: