Currently, it is possible to launch minidlna like this:
./minidlna -P my.pid -d
which creates the pidfile exactly where the user expects (in the example above -> in the current directory); however, when minidlna runs as a daemon (without "-d"), the process execs a chdir("/"), which causes the pidfile to be written elsewhere ("/my.pid").
This small patch works around the issue by requiring an absolute path as the argument to "-P", which is both safer and wiser.
NOTE1: This patch requires patch 3490290 ("Make DPRINTF macro more robust") or some extra curly braces around the DPRINTF.
NOTE2: It's probably better to exit(1) after printing the error message (at least, that would seem more natural to me, rather than ignoring the error and continuing anyway).
Log in to post a comment.