]> git.proxmox.com Git - mirror_iproute2.git/commit
lib/fs: avoid double call to mkdir on make_path()
authorAndrea Claudi <aclaudi@redhat.com>
Mon, 22 Feb 2021 18:14:31 +0000 (19:14 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 23 Feb 2021 02:20:44 +0000 (18:20 -0800)
commit1de363b1800c371037ff2b2a6c1004627e58f68e
tree49c739b127306cee9d087d0351c92e77fb43a264
parentd4fcdbbec9df2fe287e443b5a69f622768c63126
lib/fs: avoid double call to mkdir on make_path()

make_path() function calls mkdir two times in a row. The first one it
stores mkdir return code, and then it calls it again to check for errno.

This seems unnecessary, as we can use the return code from the first
call and check for errno if not 0.

Fixes: ac3415f5c1b1d ("lib/fs: Fix and simplify make_path()")
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/fs.c