blob: b9d260b957ebd220da7e607a93eee8856eb2ef96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--- mono/metadata/attach.c.orig 2009-03-03 15:32:27 -0800
+++ mono/metadata/attach.c 2009-03-03 15:48:41 -0800
@@ -366,12 +366,20 @@ ipc_connect (void)
*/
/* FIXME: Use TMP ? */
pw = NULL;
+#ifndef HAVE_GETPWUID_R
+ pw = getpwuid(getuid());
+ if (pw == NULL) {
+ fprintf(stderr, "attach: getpwuid () failed.\n");
+ return;
+ }
+#else
res = getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw);
if (res != 0) {
fprintf (stderr, "attach: getpwuid_r () failed.\n");
return;
}
g_assert (pw);
+#endif
directory = g_strdup_printf ("/tmp/mono-%s", pw->pw_name);
res = mkdir (directory, S_IRUSR | S_IWUSR | S_IXUSR);
if (res != 0) {
|