Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2008 18:33:36 GMT
From:      Ganael Laplanche <ganael.laplanche@martymac.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/121837: [patch] devel/clanlib: make CL_System::get_exe_path() work
Message-ID:  <200803181833.m2IIXaA5068966@www.freebsd.org>
Resent-Message-ID: <200803181840.m2IIe19e002206@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         121837
>Category:       ports
>Synopsis:       [patch] devel/clanlib: make CL_System::get_exe_path() work
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 18 18:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Ganael Laplanche
>Release:        7.0-STABLE
>Organization:
http://contribs.martymac.com
>Environment:
FreeBSD home.martymac.com 7.0-STABLE FreeBSD 7.0-STABLE #10: Wed Mar 12 14:04:40 CET 2008     root@home.martymac.com:/usr/obj/usr/src/sys/MYKERNEL  amd64
>Description:
Clanlib uses Linux' /proc/self/exe to get the full path of the current running process. The attached patch uses /proc/curproc/file instead to make it work under FreeBSD.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Sources/Core/System/Unix/init_linux.cpp.orig	2008-03-18 18:30:05.191894223 +0100
+++ Sources/Core/System/Unix/init_linux.cpp	2008-03-18 18:31:07.787731403 +0100
@@ -118,7 +118,7 @@
 
 #else
 	int size;
-	size = readlink("/proc/self/exe", exe_file, PATH_MAX);
+	size = readlink("/proc/curproc/file", exe_file, PATH_MAX);
 	if (size < 0)
 	{
 		throw CL_Error(strerror(errno));


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803181833.m2IIXaA5068966>