diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2017-11-09 15:43:50 -0600 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2017-11-13 15:35:57 -0600 |
commit | 7e1abfcab8ab4b918a0725a0d91b998dff116eec (patch) | |
tree | 2c5d5fb92f12579d66635aa7caad95419b33126d /watch.cpp | |
parent | 7a248bc7c30ed1fdb7d6b4255eea2430852333d1 (diff) | |
download | phosphor-bmc-code-mgmt-7e1abfcab8ab4b918a0725a0d91b998dff116eec.tar.gz phosphor-bmc-code-mgmt-7e1abfcab8ab4b918a0725a0d91b998dff116eec.zip |
Create Image Dir if not present
Instead of throwing an error, create the image directory,
if not present.
The inotify code should create the image directory if not present,
not the upload or TFTP code. Removed creating the image directory from
the TFTP here and removed from the upload in another commit.
Change-Id: I8c142283cfd5a3c87bdf2291d2e79729ec9ac319
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'watch.cpp')
-rw-r--r-- | watch.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -29,10 +29,7 @@ Watch::Watch(sd_event* loop, fs::path imgDirPath(IMG_UPLOAD_DIR); if (!fs::is_directory(imgDirPath)) { - log<level::ERR>("ERROR No Image Dir", - entry("IMAGEDIR=%s", IMG_UPLOAD_DIR)); - throw std::runtime_error( - "No Image Dir, IMAGEDIR=" + std::string{IMG_UPLOAD_DIR}); + fs::create_directories(imgDirPath); } fd = inotify_init1(IN_NONBLOCK); |