summaryrefslogtreecommitdiff
path: root/legacy/efreet
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-07-04 18:38:46 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-07-04 18:38:46 +0000
commit0b2f05e6975547d3e1716a5ae4da7efc7297320d (patch)
treef4bb8ad596b415b53b96a9abbfcedbdc0eb5ed98 /legacy/efreet
parentb8e7e4cfefc5ecd0f418b3c65a1e1346456c263f (diff)
Efreet: can not implement efreet_fsetowner() and efreet_setowner() on Windows
Seb: is it annoying ? SVN revision: 73296
Diffstat (limited to 'legacy/efreet')
-rw-r--r--legacy/efreet/src/lib/efreet.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/legacy/efreet/src/lib/efreet.c b/legacy/efreet/src/lib/efreet.c
index 5ebb376b3c..906d8794ee 100644
--- a/legacy/efreet/src/lib/efreet.c
+++ b/legacy/efreet/src/lib/efreet.c
@@ -48,17 +48,22 @@ static const char *efreet_lang_modifier = NULL;
48static void efreet_parse_locale(void); 48static void efreet_parse_locale(void);
49static int efreet_parse_locale_setting(const char *env); 49static int efreet_parse_locale_setting(const char *env);
50 50
51#ifndef _WIN32
51static uid_t ruid; 52static uid_t ruid;
52static uid_t rgid; 53static uid_t rgid;
54#endif
53 55
54EAPI int 56EAPI int
55efreet_init(void) 57efreet_init(void)
56{ 58{
59#ifndef _WIN32
57 char *tmp; 60 char *tmp;
61#endif
58 62
59 if (++_efreet_init_count != 1) 63 if (++_efreet_init_count != 1)
60 return _efreet_init_count; 64 return _efreet_init_count;
61 65
66#ifndef _WIN32
62 /* Find users real uid and gid */ 67 /* Find users real uid and gid */
63 tmp = getenv("SUDO_UID"); 68 tmp = getenv("SUDO_UID");
64 if (tmp) 69 if (tmp)
@@ -71,6 +76,7 @@ efreet_init(void)
71 rgid = strtoul(tmp, NULL, 10); 76 rgid = strtoul(tmp, NULL, 10);
72 else 77 else
73 rgid = getgid(); 78 rgid = getgid();
79#endif
74 80
75 if (!eina_init()) 81 if (!eina_init())
76 return --_efreet_init_count; 82 return --_efreet_init_count;
@@ -319,6 +325,7 @@ efreet_array_cat(char *buffer, size_t size, const char *strs[])
319 return n; 325 return n;
320} 326}
321 327
328#ifndef _WIN32
322EAPI void 329EAPI void
323efreet_fsetowner(int fd) 330efreet_fsetowner(int fd)
324{ 331{
@@ -330,7 +337,14 @@ efreet_fsetowner(int fd)
330 337
331 if (fchown(fd, ruid, rgid) != 0) return; 338 if (fchown(fd, ruid, rgid) != 0) return;
332} 339}
340#else
341EAPI void
342efreet_fsetowner(int fd __UNUSED__)
343{
344}
345#endif
333 346
347#ifndef _WIN32
334EAPI void 348EAPI void
335efreet_setowner(const char *path) 349efreet_setowner(const char *path)
336{ 350{
@@ -343,3 +357,9 @@ efreet_setowner(const char *path)
343 efreet_fsetowner(fd); 357 efreet_fsetowner(fd);
344 close(fd); 358 close(fd);
345} 359}
360#else
361EAPI void
362efreet_setowner(const char *path __UNUSED__)
363{
364}
365#endif