diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-25 03:24:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-25 03:24:18 +0000 |
commit | 54c2399a7c3c4138674e805e34217a6def116184 (patch) | |
tree | 42ef706db3566246f8d551fe6595455915ad8b4f /mcop | |
parent | 3f4a52a7c4741f2d706dafb64cfc72aaf83eee3b (diff) | |
download | arts-54c2399a7c3c4138674e805e34217a6def116184.tar.gz arts-54c2399a7c3c4138674e805e34217a6def116184.zip |
MCOP first run now creates required directory instead of throwing error message
Patch kindly provided by Darrell Anderson
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1167610 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mcop')
-rw-r--r-- | mcop/mcoputils.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mcop/mcoputils.cc b/mcop/mcoputils.cc index 2fc90f0..3922824 100644 --- a/mcop/mcoputils.cc +++ b/mcop/mcoputils.cc @@ -47,9 +47,16 @@ static int check_tmp_dir(const char *tmp_dir) int result; struct stat stat_buf; result = lstat(tmp_dir, &stat_buf); - if ((result == -1) && (errno == ENOENT)) + +if ((result == -1) && (errno == ENOENT)) { - return 1; + result = mkdir(tmp_dir, 0700); + if (result == -1) + { + arts_warning("Error: Cannot create directory \"%s\".\n", tmp_dir); + return 1; + } + result = stat(tmp_dir, &stat_buf); } if ((result == -1) || (!S_ISDIR(stat_buf.st_mode))) { |