X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=support%2Fmacros.c;h=c763a7ca2f8719d442cda74e017ee846fedf4fa8;hb=50beb484c091b7eb9fdd4cba436757c12f316b8d;hp=c5a07e634b7aff5b3d3fb02b1981ef6dfb9916e8;hpb=b2214b317a81d91443337a5148fb4fd890598605;p=mono.git diff --git a/support/macros.c b/support/macros.c index c5a07e634b7..c763a7ca2f8 100644 --- a/support/macros.c +++ b/support/macros.c @@ -6,6 +6,7 @@ #include #include #include +#include int wifexited (int status) { @@ -81,16 +82,16 @@ int helper_Mono_Posix_Stat(char *filename, int dereference, char *helper_Mono_Posix_GetUserName(int uid) { struct passwd *p = getpwuid(uid); if (p == NULL) return NULL; - return p->pw_name; + return strdup (p->pw_name); } char *helper_Mono_Posix_GetGroupName(int gid) { struct group *p = getgrgid(gid); if (p == NULL) return NULL; - return p->gr_name; + return strdup (p->gr_name); } char *helper_Mono_Posix_readdir(DIR *dir) { struct dirent* e = readdir(dir); if (e == NULL) return NULL; - return e->d_name; + return strdup (e->d_name); }