Re: [PATCH 2/2] CLEANUP: namespace: remove uneeded ns check in my_socketat

2020-02-13 Thread Willy Tarreau
On Thu, Feb 13, 2020 at 08:38:38AM +0100, William Dauchy wrote: (...) > > This allows to remove the !ns || default_namespace logic from > > the function's epilogue. What do you think ? > > Indeed, that's clearer in my opinion. I guess I let you handle that > as you wrote the new proposition. So

Re: [PATCH 2/2] CLEANUP: namespace: remove uneeded ns check in my_socketat

2020-02-12 Thread William Dauchy
On Thu, Feb 13, 2020 at 07:48:03AM +0100, Willy Tarreau wrote: > For me it's different, it's not related to the fact that it's used > later but to the fact that we only need to undo the namespace change > if it was changed in the first call. Indeed "ns" is not null only > when the caller wants to

Re: [PATCH 2/2] CLEANUP: namespace: remove uneeded ns check in my_socketat

2020-02-12 Thread Willy Tarreau
On Wed, Feb 12, 2020 at 09:42:06PM +0100, William Dauchy wrote: > On Thu, Feb 13, 2020 at 01:31:51AM +0500, ??? wrote: > > we "use" it. > > depending on true/false we either return -1 or not > > I guess it is present in the first condition to be able to access > `ns->fd` safely in setns;

Re: [PATCH 2/2] CLEANUP: namespace: remove uneeded ns check in my_socketat

2020-02-12 Thread William Dauchy
On Thu, Feb 13, 2020 at 01:31:51AM +0500, Илья Шипицин wrote: > we "use" it. > depending on true/false we either return -1 or not I guess it is present in the first condition to be able to access `ns->fd` safely in setns; but the second condition does not acces `ns` later. -- William

Re: [PATCH 2/2] CLEANUP: namespace: remove uneeded ns check in my_socketat

2020-02-12 Thread Илья Шипицин
чт, 13 февр. 2020 г. в 01:26, William Dauchy : > we check ns variable but we don't use it later > we "use" it. depending on true/false we either return -1 or not > > Signed-off-by: William Dauchy > --- > src/namespace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git