X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fwrapper%2Fwrapper.c;h=6ad29668e0407ebf14003cec9e46f62bd709e9ba;hb=b2262f41726a89c8209facb3ea9e4be9582422b5;hp=1d24e96e389ffbab335c185c5f148b23ea0f49f1;hpb=4b15ad68c4e71728ec7f3474ecbcfec269c67459;p=mono.git diff --git a/mono/wrapper/wrapper.c b/mono/wrapper/wrapper.c index 1d24e96e389..6ad29668e04 100644 --- a/mono/wrapper/wrapper.c +++ b/mono/wrapper/wrapper.c @@ -6,7 +6,9 @@ #include #include #include +#ifdef HAVE_UTIME_H #include +#endif #include "wrapper.h" extern char **environ; @@ -54,15 +56,15 @@ mono_wrapper_fstat (gpointer fd, MonoWrapperStat* buf) if (fstat ((int)fd, &fs) == -1) return -errno; - buf->st_dev = fs.st_dev; - buf->st_mode = fs.st_mode; - buf->st_nlink = fs.st_nlink; - buf->st_uid = fs.st_uid; - buf->st_gid = fs.st_gid; - buf->st_size = fs.st_size; - buf->st_atime = fs.st_atime; - buf->st_mtime = fs.st_ctime; - buf->st_ctime = fs.st_ctime; + buf->mst_dev = fs.st_dev; + buf->mst_mode = fs.st_mode; + buf->mst_nlink = fs.st_nlink; + buf->mst_uid = fs.st_uid; + buf->mst_gid = fs.st_gid; + buf->mst_size = fs.st_size; + buf->mst_atime = fs.st_atime; + buf->mst_mtime = fs.st_mtime; + buf->mst_ctime = fs.st_ctime; return 0; } @@ -101,15 +103,15 @@ mono_wrapper_stat (const char * path, MonoWrapperStat* buf) if (stat (path, &fs) != 0) return errno; - buf->st_dev = fs.st_dev; - buf->st_mode = fs.st_mode; - buf->st_nlink = fs.st_nlink; - buf->st_uid = fs.st_uid; - buf->st_gid = fs.st_gid; - buf->st_size = fs.st_size; - buf->st_atime = fs.st_atime; - buf->st_mtime = fs.st_ctime; - buf->st_ctime = fs.st_ctime; + buf->mst_dev = fs.st_dev; + buf->mst_mode = fs.st_mode; + buf->mst_nlink = fs.st_nlink; + buf->mst_uid = fs.st_uid; + buf->mst_gid = fs.st_gid; + buf->mst_size = fs.st_size; + buf->mst_atime = fs.st_atime; + buf->mst_mtime = fs.st_mtime; + buf->mst_ctime = fs.st_ctime; return 0; } @@ -135,9 +137,6 @@ mono_wrapper_readdir (gpointer dir) p = readdir((DIR*)dir); - // fixme: ugly hack - remove this code ASAP - return mono_string_new (p); - return p != NULL ? p->d_name : NULL; } @@ -162,8 +161,10 @@ mono_wrapper_environ () int mono_wrapper_mkdir (const char *path, int mode) { +#ifndef PLATFORM_WIN32 if (mkdir (path, mode) == -1) return -errno; +#endif return 0; } @@ -186,6 +187,7 @@ mono_wrapper_rename (const char *src, const char *dst) int mono_wrapper_utime (const char *path, int atime, int mtime) { +#ifndef PLATFORM_WIN32 struct utimbuf buf; buf.actime = atime; @@ -193,6 +195,7 @@ mono_wrapper_utime (const char *path, int atime, int mtime) if (utime (path, &buf) == -1) return -errno; +#endif return 0; }