Merge "Bugfix for libportable to make compile happy."

This commit is contained in:
Andrew Hsieh
2014-09-16 03:21:47 +00:00
committed by Gerrit Code Review
3 changed files with 24 additions and 24 deletions

View File

@@ -169,7 +169,7 @@ int WRAP(fesetround)(int __round) {
}
int WRAP(feholdexcept)(fenv_t_portable* __envp) {
memset(__envp, '\0', sizeof(__envp));
memset(__envp, '\0', sizeof(fenv_t_portable));
fenv_t env;
int ret = REAL(feholdexcept)(&env);
memcpy(__envp, &env, sizeof(env));

View File

@@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef _STAT_PORTABLE_H_
#define _STAT_PORTABLE_H_
#ifndef _StatPortable_H_
#define _StatPortable_H_
#include <portability.h>
#include <stdint.h>
@@ -43,12 +43,12 @@
unsigned long st_ctime_nsec; \
unsigned char padding3[8];
struct stat_portable { __STAT64_BODY_PORTABLE };
#define stat64_portable stat_portable
struct StatPortable { __STAT64_BODY_PORTABLE };
typedef struct StatPortable Stat64Portable;
static inline void stat_n2p(struct stat* pn, struct stat_portable* pp)
static inline void stat_n2p(struct stat* pn, struct StatPortable* pp)
{
memset(pp, '\0', sizeof(struct stat_portable));
memset(pp, '\0', sizeof(struct StatPortable));
pp->st_dev = pn->st_dev;
pp->st_ino = pn->st_ino;
pp->st_mode = pn->st_mode;
@@ -67,7 +67,7 @@ static inline void stat_n2p(struct stat* pn, struct stat_portable* pp)
pp->st_ctime_nsec = pn->st_ctime_nsec;
}
int WRAP(fstat)(int a, struct stat_portable* p)
int WRAP(fstat)(int a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(fstat)(a, &target_stat_obj);
@@ -75,12 +75,12 @@ int WRAP(fstat)(int a, struct stat_portable* p)
return ret;
}
int WRAP(fstat64)(int a, struct stat64_portable* p)
int WRAP(fstat64)(int a, Stat64Portable* p)
{
return WRAP(fstat)(a, p);
}
int WRAP(fstatat)(int a, const char* p1, struct stat_portable* p2, int b)
int WRAP(fstatat)(int a, const char* p1, struct StatPortable* p2, int b)
{
struct stat target_stat_obj;
int ret = REAL(fstatat)(a, p1, &target_stat_obj, b);
@@ -88,12 +88,12 @@ int WRAP(fstatat)(int a, const char* p1, struct stat_portable* p2, int b)
return ret;
}
int WRAP(fstatat64)(int a, const char* b, struct stat64_portable* c, int d)
int WRAP(fstatat64)(int a, const char* b, Stat64Portable* c, int d)
{
return WRAP(fstatat)(a, b, c, d);
}
int WRAP(lstat)(const char* a, struct stat_portable* p)
int WRAP(lstat)(const char* a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(lstat)(a, &target_stat_obj);
@@ -101,12 +101,12 @@ int WRAP(lstat)(const char* a, struct stat_portable* p)
return ret;
}
int WRAP(lstat64)(const char* a, struct stat64_portable* p)
int WRAP(lstat64)(const char* a, Stat64Portable* p)
{
return WRAP(lstat)(a, p);
}
int WRAP(stat)(const char* a, struct stat_portable* p)
int WRAP(stat)(const char* a, struct StatPortable* p)
{
struct stat target_stat_obj;
int ret = REAL(stat)(a, &target_stat_obj);
@@ -114,9 +114,9 @@ int WRAP(stat)(const char* a, struct stat_portable* p)
return ret;
}
int WRAP(stat64)(const char* a, struct stat64_portable* p)
int WRAP(stat64)(const char* a, Stat64Portable* p)
{
return WRAP(stat)(a, p);
}
#endif /* _STAT_PORTABLE_H */
#endif /* _StatPortable_H */

View File

@@ -39,14 +39,14 @@ typedef __fsid_t fsid_t;
uint64_t f_spare[5];
struct statfs_portable { __STATFS64_BODY_PORTABLE };
#define statfs64_portable statfs_portable
struct StatfsPortable { __STATFS64_BODY_PORTABLE };
typedef struct StatfsPortable Statfs64Portable;
#undef __STATFS64_BODY_PORTABLE
static void statfs_n2p(const struct statfs* pn, struct statfs_portable* pp)
static void statfs_n2p(const struct statfs* pn, struct StatfsPortable* pp)
{
memset(pp, '\0', sizeof(struct statfs_portable));
memset(pp, '\0', sizeof(struct StatfsPortable));
pp->f_type = pn->f_type;
pp->f_bsize = pn->f_bsize;
pp->f_blocks = pn->f_blocks;
@@ -65,7 +65,7 @@ static void statfs_n2p(const struct statfs* pn, struct statfs_portable* pp)
#endif
}
int WRAP(statfs)(const char* path, struct statfs_portable* stat)
int WRAP(statfs)(const char* path, struct StatfsPortable* stat)
{
struct statfs target_stat;
int ret = REAL(statfs)(path, &target_stat);
@@ -73,12 +73,12 @@ int WRAP(statfs)(const char* path, struct statfs_portable* stat)
return ret;
}
int WRAP(statfs64)(const char* path, struct statfs64_portable* stat)
int WRAP(statfs64)(const char* path, Statfs64Portable* stat)
{
return WRAP(statfs)(path, stat);
}
int WRAP(fstatfs)(int fd, struct statfs_portable* stat)
int WRAP(fstatfs)(int fd, struct StatfsPortable* stat)
{
struct statfs target_stat;
int ret = REAL(fstatfs)(fd, &target_stat);
@@ -86,7 +86,7 @@ int WRAP(fstatfs)(int fd, struct statfs_portable* stat)
return ret;
}
int WRAP(fstatfs64)(int fd, struct statfs64_portable* stat)
int WRAP(fstatfs64)(int fd, Statfs64Portable* stat)
{
return WRAP(fstatfs)(fd, stat);
}