forked from enlightenment/efl
Efreet: can not implement efreet_fsetowner() and efreet_setowner() on Windows
Seb: is it annoying ? SVN revision: 73296
This commit is contained in:
parent
b8e7e4cfef
commit
0b2f05e697
|
@ -48,17 +48,22 @@ static const char *efreet_lang_modifier = NULL;
|
||||||
static void efreet_parse_locale(void);
|
static void efreet_parse_locale(void);
|
||||||
static int efreet_parse_locale_setting(const char *env);
|
static int efreet_parse_locale_setting(const char *env);
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
static uid_t ruid;
|
static uid_t ruid;
|
||||||
static uid_t rgid;
|
static uid_t rgid;
|
||||||
|
#endif
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
efreet_init(void)
|
efreet_init(void)
|
||||||
{
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (++_efreet_init_count != 1)
|
if (++_efreet_init_count != 1)
|
||||||
return _efreet_init_count;
|
return _efreet_init_count;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
/* Find users real uid and gid */
|
/* Find users real uid and gid */
|
||||||
tmp = getenv("SUDO_UID");
|
tmp = getenv("SUDO_UID");
|
||||||
if (tmp)
|
if (tmp)
|
||||||
|
@ -71,6 +76,7 @@ efreet_init(void)
|
||||||
rgid = strtoul(tmp, NULL, 10);
|
rgid = strtoul(tmp, NULL, 10);
|
||||||
else
|
else
|
||||||
rgid = getgid();
|
rgid = getgid();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!eina_init())
|
if (!eina_init())
|
||||||
return --_efreet_init_count;
|
return --_efreet_init_count;
|
||||||
|
@ -319,6 +325,7 @@ efreet_array_cat(char *buffer, size_t size, const char *strs[])
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
EAPI void
|
EAPI void
|
||||||
efreet_fsetowner(int fd)
|
efreet_fsetowner(int fd)
|
||||||
{
|
{
|
||||||
|
@ -330,7 +337,14 @@ efreet_fsetowner(int fd)
|
||||||
|
|
||||||
if (fchown(fd, ruid, rgid) != 0) return;
|
if (fchown(fd, ruid, rgid) != 0) return;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
EAPI void
|
||||||
|
efreet_fsetowner(int fd __UNUSED__)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
EAPI void
|
EAPI void
|
||||||
efreet_setowner(const char *path)
|
efreet_setowner(const char *path)
|
||||||
{
|
{
|
||||||
|
@ -343,3 +357,9 @@ efreet_setowner(const char *path)
|
||||||
efreet_fsetowner(fd);
|
efreet_fsetowner(fd);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
EAPI void
|
||||||
|
efreet_setowner(const char *path __UNUSED__)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue