On Mon, 03.11.14 13:46, David Herrmann ([email protected]) wrote: > static inline int negative_errno(void) { > assert_return(errno > 0, -EINVAL); > return -errno; > }
Looks great to me! But please add a comment next to it, explaining why to use this. I mean, we should really clarify that "return -errno" is usually enough, and "return negative_errno()" is really just about making gcc shut up, and should not be used for cases unlike the one you ran into. Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
