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
v3.5.13-sru
tpearson 14 years ago
parent 3f4a52a7c4
commit 54c2399a7c

@ -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)))
{

Loading…
Cancel
Save