[med-svn] [aghermann] 05/34: rk1968::save(): do mkdir_with_parents(profile_dir), as is done in base method

andrei zavada hmmr-guest at moszumanska.debian.org
Sat Nov 23 00:46:47 UTC 2013


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to branch master
in repository aghermann.

commit f658d4d69c048f257e4a7d65e79b2c069eff114c
Author: andrei zavada <hmmr at fa2>
Date:   Tue Nov 12 18:24:59 2013 +0200

    rk1968::save(): do mkdir_with_parents(profile_dir), as is done in base method
---
 upstream/src/aghermann/rk1968/rk1968.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/upstream/src/aghermann/rk1968/rk1968.cc b/upstream/src/aghermann/rk1968/rk1968.cc
index cf59c8a..8f10a9a 100644
--- a/upstream/src/aghermann/rk1968/rk1968.cc
+++ b/upstream/src/aghermann/rk1968/rk1968.cc
@@ -83,7 +83,13 @@ int
 CScoreAssistant::
 save() const
 {
-        ofstream oleg (path());
+        string p = path();
+        if ( fs::mkdir_with_parents( fs::dirname(p)) ) {
+                APPLOG_WARN ("mkdir(\"%s\") failed: %s", p.c_str(), strerror(errno));
+                return -1;
+        }
+
+        ofstream oleg (p);
         oleg << script_contents;
 
         return 0;

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list