Util-Linux package development
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Stef Walter <stefw@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] agetty: Reprompt once the network addresses change if address displayed
Date: Mon, 6 Jul 2015 10:07:11 -0400	[thread overview]
Message-ID: <20150706140711.GF17734@vapier> (raw)
In-Reply-To: <1435928288-25644-1-git-send-email-stefw@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

On 03 Jul 2015 14:58, Stef Walter wrote:
  #ifdef AGETTY_RELOAD
>  # include <sys/inotify.h>
> +# include <linux/netlink.h>
> +# include <linux/rtnetlink.h>

why not use libmnl instead ?
	http://netfilter.org/projects/libmnl

> +static void open_netlink(void)
> +{
> ...
> +		if (bind(sock,(struct sockaddr *)&addr, sizeof(addr)) < 0)

need space after the first ,

> +			close (sock);

no space before the (

> +static int process_netlink_msg(int *changed)
> +{
> +	char buf[4096];
> +	struct sockaddr_nl snl;
> +	struct iovec iov = { buf, sizeof buf };
> +	struct msghdr msg = { (void*)&snl, sizeof (snl), &iov, 1, NULL, 0, 0 };

would be nice to use nmed initializers imo.  makes it easier to read, more 
portable, and less error prone.

	struct iovec iov = {
		.iov_base = ...,
		.iov_len = ...,
	};

also your use of parens w/sizeof is inconsistent.  should use them, and not put 
a space between them.

> +		close (netlink_fd);

no space before the (

> +			close (netlink_fd);

same here

> +	for (;;) {

while (1) is more common i think

> +		} else if (inotify_fd >= 0 && FD_ISSET (inotify_fd, &rfds)) {

no space before the (
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-07-06 14:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 12:58 [PATCH] agetty: Reprompt once the network addresses change if address displayed Stef Walter
2015-07-06 14:07 ` Mike Frysinger [this message]
2015-07-06 18:58   ` Bruce Dubbs
2015-07-07  4:25     ` Mike Frysinger
2015-07-07  5:05       ` Bruce Dubbs
2015-07-07  7:07         ` Mike Frysinger
2015-07-07 14:56           ` Bruce Dubbs
2015-07-07 15:56             ` Mike Frysinger
2015-07-09  7:20   ` Stef Walter
2015-07-20  9:26     ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150706140711.GF17734@vapier \
    --to=vapier@gentoo.org \
    --cc=stefw@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox