diff options
-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))) { |