[systemd-devel] [PATCH v2] hostname: Allow comments in /etc/hostname

Martin Pitt martin.pitt at ubuntu.com
Mon May 18 03:36:06 PDT 2015

Hey Thomas,

Thomas H.P. Andersen [2015-05-18 11:49 +0200]:
> On Mon, May 18, 2015 at 11:33 AM, Martin Pitt <martin.pitt at ubuntu.com> wrote:
> > This currently uses read_full_file() and strv_split_newlines() which
> > is relatively expensive (although, in most cases there will only be
> > one line). In cases like these should we rather use an fgets() loop?
> I think FOREACH_LINE would make this more readable.

Indeed, thanks for pointing out! Updated patch attached.

Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-hostname-Allow-comments-in-etc-hostname.patch
Type: text/x-diff
Size: 3570 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150518/e57ae507/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150518/e57ae507/attachment.sig>

More information about the systemd-devel mailing list