Commits

releng  committed 130ae17

CWS-TOOLING: integrate CWS sysui311_DEV300
2009-08-11 18:30:31 +0200 ihi r274874 : #104116# use __lxstat wrapper for X86_64 Linux

  • Participants
  • Parent commits e70e5c6

Comments (0)

Files changed (1)

File setup_native/scripts/source/getuid.c

 
     return ret;
 }
-
-#elif defined LINUX
+#elif  defined LINUX
 
 uid_t getuid  (void) {return 0;}
 uid_t geteuid (void) {return 0;}
 
 /* This is to fool tar */
+#ifdef X86_64
+int __lxstat(int n, const char *path, struct stat *buf)
+{
+    int ret = 0;
+    static int (*p_lstat) (int n, const char *path, struct stat *buf) = NULL;
+    if (p_lstat == NULL)
+        p_lstat = (int (*)(int n, const char *path, struct stat *buf))
+            dlsym (RTLD_NEXT, "__lxstat");
+    ret = (*p_lstat)(n, path, buf);
+    if (buf != NULL)
+    {
+        buf->st_uid = 0; /* root */
+        buf->st_gid = 0; /* root */
+    }
+    return ret;
+}
+#else
 int __lxstat64(int n, const char *path, struct stat64 *buf)
 {
     int ret = 0;
     ret = (*p_lstat)(n, path, buf);
     if (buf != NULL)
     {
-        buf->st_uid = 0; /* root */
-        buf->st_gid = 0; /* root */
+        buf->st_uid = 0;
+        buf->st_gid = 0; 
     }
-
     return ret;
 }
-
+#endif
 #endif
 
 #ifdef _cplusplus