[systemd-devel] [PATCH] RFC: util: Avoid memory allocations for formatting paths

Holger Hans Peter Freyther holger at freyther.de
Wed Apr 3 06:54:04 PDT 2013


On Wed, Apr 03, 2013 at 02:59:18PM +0200, Lennart Poettering wrote:
> On Wed, 03.04.13 08:27, Holger Freyther (holger at freyther.de) wrote:
> 
> > +#define PROCFS_PATH_LEN (sizeof("/proc/")-1 + DECIMAL_STR_MAX(unsigned long))
> 
> Even though we use %lu to actually print the PID it's stil in the PID
> range, so I'd prefer using DECIMAL_STR_MAX(pid_t) here...

Well, I disagree but don't care enough to argue for unsigned long.


> Otherwise looks pretty good!

I will send an updated patch soon.


More information about the systemd-devel mailing list