On Wed, Jul 17, 2024 at 8:21 PM Nathan Hartman <hartman.nat...@gmail.com> wrote:
>
> On Wed, Jul 17, 2024 at 10:31 AM Timofei Zhakov <t...@chemodax.net> wrote:
> (snipping most content)
> > When I was was doing that, I solved the problem with uname with a
> > little patch by adding ifdef over release_name_from_uname() invocation
> > in sysinfo.c:
> >
> > [[[
> > Index: subversion/libsvn_subr/sysinfo.c
> > ===================================================================
> > --- subversion/libsvn_subr/sysinfo.c    (revision 1919186)
> > +++ subversion/libsvn_subr/sysinfo.c    (working copy)
> > @@ -646,8 +646,12 @@
> >  static const char *
> >  linux_release_name(apr_pool_t *pool)
> >  {
> > -  const char *uname_release = release_name_from_uname(pool);
> > +  const char *uname_release;
> >
> > +#if HAVE_UNAME
> > +  uname_release = release_name_from_uname(pool);
> > +#endif
> (snipping the rest...)
>
> If HAVE_UNAME is not defined, then uname_release will point to
> undefined address? I think we need some default string. Perhaps
> "unknown"?

Hi,

Yes it will. However, as I understand the implementation of
release_name_from_uname(), it returns NULL if the uname cannot be
recognized (see sysinfo.c:312).

Additionally, the svn_sysinfo__release_name function (which will
return that NULL) could do that, because (sysinfo.h:41):

[[[
Return the release name (i.e., marketing name) of the running
system, or NULL if it's not available.

All allocations are done in POOL.
]]]

However, "unknown" might be better than NULL...

-- 
Timofei Zhakov

Reply via email to