On Mon, 20.04.15 14:58, Zbigniew Jędrzejewski-Szmek ([email protected]) wrote:
> On Mon, Apr 20, 2015 at 04:43:20PM +0200, Lennart Poettering wrote: > > On Tue, 14.04.15 21:58, Zbigniew Jędrzejewski-Szmek ([email protected]) > > wrote: > > > > > +const char *audit_type_name(int type, > > > + char buf[AUDIT_NAME_BUF_SIZE]) { > > > + const char *s; > > > + > > > + s = audit_type_to_string(type); > > > + if (s) > > > + return s; > > > + > > > + /* This is inspired by DNS TYPEnnn formatting */ > > > + snprintf(buf, AUDIT_NAME_BUF_SIZE, "AUDIT%04i", type); > > > + return buf; > > > > Shouldn't we stick to <audit-xyz> at least, to stay congruent to what > > we so far did, at least for the unknown ones? > I thought the visual difference between the capitalized names and what we > used so far is too big: e.g. ADD_USER and <audit-1114>, and it is better > to have something visually similar at least. Hmm, I see. You do have a point, hence go ahead. > > Also, may turn this into a macro expression using ({}) that returns > > this as alloca() allocated string? > > You mean the whole function? I'll try that. The only downside is it > cannot be called directly in the args to another function. Yeah, the whole function. Make sure to name this in a way that it is clear that this is an alloca()-based macro, by including an _alloca() suffix or so? Also see procfs_file_alloca() or inspiration. Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
