On 08/27/2014 03:08 PM, Fridolin Pokorny wrote:
> diff --git a/lib/mountlist.c b/lib/mountlist.c
Cool, this fits well.
It would be good to mention the functionality and
performance benefits in the changelog.
> +#ifdef MOUNTED_PROC_MOUNTINFO
> +static const char *
> +mountinfo_path (void) {
> + static char filename[sizeof ("/proc//mountinfo") + 13]; /* 13 to hold a
> PID */
> +
> + sprintf (filename, "/proc/%u/mountinfo", getpid ());
> +
> + return filename;
> +}
I dislike the above as it precludes concurrent usage.
You could avoid that issue by allocating on the heap,
but can't this be simplified by using /proc/self/mountinfo ?
thanks!
Pádraig.