[PATCH] rrd_daemon: pay attention to the return value of realpath

Alex Bennee <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Ooop, should of hit replay-all

---------- Forwarded message ----------

On 15 November 2010 15:51, kevin brintnall <[email protected]> wrote:
> It looks like setting the 2nd arg of realpath() to NULL is not a portable
> way to cause it to be strdup()'ed.  i.e. on Solaris 2.8:
>      EINVAL
>            Either the file_name or resolved_name  argument  is  a
>            null pointer.
> So perhaps keeping the original strdup(realpath()) would make more sense.
> Also, checking specifically for error of realpath() and returning on error
> might shrink the diff.  Style change only.

Ahh yes, I saw POSIX and assumed it was portable, but:

"POSIX.1-2001 says that the behavior if resolved_path is NULL is
implementation-defined.  POSIX.1-2008 specifies the behavior described
in this page."

Really however the code needs to be re-worked so directory creation
works again. Is there a portable way of checking if a path is relative
and needs a realpath step?

--
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk



-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.