On Tue, 19.05.15 07:56, Martin Pitt (martin.p...@ubuntu.com) wrote: > Hey Lennart, > > Lennart Poettering [2015-05-18 17:12 +0200]: > > This code will result in ENOENT being returned on OOM... That's not right... > > Fixed. > > > Also consider using strstrip() here. > > hostname_cleanup() already filters out whitespace, so I don't think > that's needed?
true! > > Given that this same code is needed twice in different components, > > please add a new call read_etc_hostname() to > > src/shared/hostname-util.c (which I just added to git). It should then > > also do hostname_cleanup() on the name, and thus pretty much replace > > read_and_strip_hostname() entirely in hostname-setup.c. > > Done. However, I called the function read_hostname_config() and give > it a path argument. This is mostly so that we can write tests for it, > but maybe one of these days we actually want to use it for other > purposes (reading hostnames from container root fs). Thanks! Applied! Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel