|
|
@ -83,7 +83,7 @@ static char *locate_mcop_dir()
|
|
|
|
string user_tmp_dir;
|
|
|
|
string user_tmp_dir;
|
|
|
|
int uid = getuid();
|
|
|
|
int uid = getuid();
|
|
|
|
const char *home_dir = getenv("HOME");
|
|
|
|
const char *home_dir = getenv("HOME");
|
|
|
|
const char *kde_home = uid ? getenv("KDEHOME") : getenv("KDEROOTHOME");
|
|
|
|
const char *kde_home = uid ? getenv("TDEHOME") : getenv("KDEROOTHOME");
|
|
|
|
const char *kde_prefix = "/socket-";
|
|
|
|
const char *kde_prefix = "/socket-";
|
|
|
|
const char *tmp;
|
|
|
|
const char *tmp;
|
|
|
|
char *tmp_buf;
|
|
|
|
char *tmp_buf;
|
|
|
@ -151,7 +151,7 @@ static char *locate_mcop_dir()
|
|
|
|
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
|
|
|
|
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
|
|
|
|
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
|
|
|
|
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* $KDEHOME/socket-$HOSTNAME is a normal directory. Do nothing. */
|
|
|
|
/* $TDEHOME/socket-$HOSTNAME is a normal directory. Do nothing. */
|
|
|
|
tmp_buf = strdup(kde_tmp_dir.c_str());
|
|
|
|
tmp_buf = strdup(kde_tmp_dir.c_str());
|
|
|
|
return tmp_buf;
|
|
|
|
return tmp_buf;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -231,7 +231,7 @@ int build_link(string tmp_prefix, const char *kde_prefix)
|
|
|
|
char *tmp_buf;
|
|
|
|
char *tmp_buf;
|
|
|
|
int uid = getuid();
|
|
|
|
int uid = getuid();
|
|
|
|
const char *home_dir = getenv("HOME");
|
|
|
|
const char *home_dir = getenv("HOME");
|
|
|
|
const char *kde_home = uid ? getenv("KDEHOME") : getenv("KDEROOTHOME");
|
|
|
|
const char *kde_home = uid ? getenv("TDEHOME") : getenv("KDEROOTHOME");
|
|
|
|
int result;
|
|
|
|
int result;
|
|
|
|
struct stat stat_buf;
|
|
|
|
struct stat stat_buf;
|
|
|
|
|
|
|
|
|
|
|
@ -295,7 +295,7 @@ int build_link(string tmp_prefix, const char *kde_prefix)
|
|
|
|
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
|
|
|
|
result = lstat(kde_tmp_dir.c_str(), &stat_buf);
|
|
|
|
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
|
|
|
|
if ((result == 0) && (S_ISDIR(stat_buf.st_mode)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* $KDEHOME/tmp is a normal directory. Do nothing. */
|
|
|
|
/* $TDEHOME/tmp is a normal directory. Do nothing. */
|
|
|
|
printf("Directory \"%s\" already exists.\n", kde_tmp_dir.c_str());
|
|
|
|
printf("Directory \"%s\" already exists.\n", kde_tmp_dir.c_str());
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|