summaryrefslogtreecommitdiff
path: root/security/gnome-keyring/files/patch-gnome-keyring-daemon.c
blob: 293df59b976f85a17d27ad3f8ec0233516454386 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- gnome-keyring-daemon.c.orig	Tue Jul 20 22:41:27 2004
+++ gnome-keyring-daemon.c	Tue Jul 20 22:43:03 2004
@@ -121,7 +121,7 @@
 	int i;
 
 	got_random = FALSE;
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 	{
 		int fd;
 
@@ -352,6 +352,22 @@
 			app_ref->pathname[len] = 0;
 		}
 		
+	}
+#elif defined(__FreeBSD__)
+	{
+		char buffer[1024];
+		int len;
+		char *path;
+
+		path = g_strdup_printf ("/proc/%d/file", pid);
+		len = readlink (path, buffer, sizeof (buffer));
+		g_free (path);
+
+		if (len > 0) {
+			app_ref->pathname = g_malloc (len + 1);
+			memcpy (app_ref->pathname, buffer, len);
+			app_ref->pathname[len] = 0;
+		}
 	}
 #endif