On Sat, 08.03.14 20:33, Josh Triplett ([email protected]) wrote: > avoid_cleanup also returns a copy of the pointer, making it convenient > to use at the point where initialization completes, to hand the constructed > object off somewhere without freeing it. > > Change all NULL assignments tagged with /* avoid cleanup */ to use this > instead. > --- > > Seems like a common pattern, and this makes it more self-documenting. > In particular, the use in systemctl.c's list_timers function now feels > like a single logical operation of "hand ownership of this object off to > something else and don't clean it up".
Hmmm, I am all for synctactic sugar, but I don't see the benefit of this one really... Especially given that that disabling cleanup is done different for different types... For example, disabling cleanup for an fd is by assigning -1... I would see benefit in this if we could maybe make this type-sensitive... not sure though if C would allow that? I at least cannot think of a way to do that? Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
