Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Jul 2016 12:30:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 209742] devel/godot: Improve port (v2.0.3); add devel/godot-tools port
Message-ID:  <bug-209742-13-m9lfrOI7hw@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209742-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209742-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209742

lightside <lightside@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #172034|maintainer-approval?(FreeBS |
              Flags|D@ShaneWare.Biz)            |
 Attachment #172034|0                           |1
        is obsolete|                            |
 Attachment #172038|                            |maintainer-approval?(FreeBS
              Flags|                            |D@ShaneWare.Biz)

--- Comment #42 from lightside <lightside@gmx.com> ---
Created attachment 172038
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D172038&action=
=3Dedit
Proposed patch (since 415742 revision)

(In reply to comment #41)
> I don't see the need for the extra if() - To include the extra WARN_PRINT
> add it after if(sysctl()!=3D0) when you set the string to zero length, as=
 you
> setting the string to zero length there would be no point in creating the
> String and testing if it equals ""
I guess, the check for empty string might be needed, in case sysctl returns
empty string (not sure, if this is possible, but still), like in Linux case=
 for
readlink. This is two exception cases, which were combined into one WARN_PR=
INT.
The "buf[0] =3D '\0';" is similar to Linux case with "memset(buf,0,256);"

But from the code of vn_fullpath1 function, it assigns '\0' to last buf(fer)
position:
https://github.com/freebsd/freebsd/blob/28823d06561e2e9911180b17a57e05ff19d=
7cbf6/sys/kern/vfs_cache.c#L1303
So it should be ok without manual assign.

You could check various examples on the following search request:
https://github.com/freebsd/freebsd/search?q=3DKERN_PROC_PATHNAME

The source code for sysctl_kern_proc_pathname function is here, for referen=
ce:
https://github.com/freebsd/freebsd/blob/736e07849585def123cc8c3042c05c77f3d=
11e2e/sys/kern/kern_proc.c#L1995

Particularly, there is even "/proc/curproc/file" example (for readlink usag=
e,
instead of "/proc/self/exe", like in Linux case):
https://github.com/freebsd/freebsd/blob/bb4ff000de429abf7115b8d078833c46838=
7f1dd/contrib/libexecinfo/backtrace.c#L55
which works, but returns warnings several times, if used similarly as for L=
inux
case.

But there is explicit differentiation in compiler-rt source code (sysctl for
FreeBSD and readlink for others):
https://github.com/freebsd/freebsd/blob/9c27ec33f2c82fe6c60c9c375a88f96a1e1=
0a6a2/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc#L715

In case of pathname request for other process, there is an example with che=
ck
for "len =3D=3D 0 || strlen(pathname) =3D=3D 0" and "No cached pathname for=
 process"
error:
https://github.com/freebsd/freebsd/blob/290f0204ae95d6dc92ba9c15fafe090e9d4=
338af/tools/test/ptrace/scescx.c#L170

New patch attached, with your suggestion.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-209742-13-m9lfrOI7hw>