]> git.proxmox.com Git - mirror_iproute2.git/commit
lib/fs: Fix and simplify make_path()
authorPhil Sutter <phil@nwl.cc>
Thu, 24 Aug 2017 09:41:30 +0000 (11:41 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 24 Aug 2017 22:22:10 +0000 (15:22 -0700)
commitac3415f5c1b1df2d6a4bf770ad52e2e14c09e58e
tree7f69b2d71c199fb8bb9dae6027801cad91685553
parentb5c78e1b2c8681e82684f47563acd3d383893658
lib/fs: Fix and simplify make_path()

Calling stat() before mkdir() is racey: The entry might change in
between. Also, the call to stat() seems to exist only to check if the
directory exists already. So simply call mkdir() unconditionally and
catch only errors other than EEXIST.

Signed-off-by: Phil Sutter <phil@nwl.cc>
lib/fs.c