[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] Fix some minor issues.
From: |
olafBuddenhagen |
Subject: |
Re: [PATCH 1/2] Fix some minor issues. |
Date: |
Wed, 12 Aug 2009 14:42:59 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
Hi,
On Mon, Aug 10, 2009 at 11:11:41PM +0300, Sergiu Ivanov wrote:
> * eth-multiplexer/device_impl.c (ds_device_open): Check if
> openstat flags are a subset of mode flags (not conversely).
> * eth-multiplexer/vdev.c (add_vdev): Copy name only if it
> is not NULL.
Why are you putting these two changes in one patch? They seem rather
orthogonal.
> While the second fix is obvious, I cannot explain for sure why do we
> need the first fix. What I can tell exactly is that without it the
> .MASTER node does not work. I think I will have to investigate into
> this issue further in the future.
Don't make changes you do not understand...
> diff --git a/eth-multiplexer/device_impl.c b/eth-multiplexer/device_impl.c
> index f9c8fc3..4b2d37d 100644
> --- a/eth-multiplexer/device_impl.c
> +++ b/eth-multiplexer/device_impl.c
> @@ -122,9 +122,9 @@ ds_device_open (mach_port_t master_port, mach_port_t
> reply_port,
> dev = (struct vether_device *) pi->po->np->nn->ln;
> /* check the mode */
> openstat = pi->po->openstat;
> - if (mode & D_READ && !(openstat & O_READ))
> + if ((openstat & O_READ) && !(mode & D_READ))
> right_mode = 0;
> - if (mode & D_WRITE && !(openstat & O_WRITE))
> + if ((openstat & O_WRITE) && !(mode & D_WRITE))
The only actual change here seems to be the added parenthesis? Or am I
missing something?...
> diff --git a/eth-multiplexer/vdev.c b/eth-multiplexer/vdev.c
> index dac9802..6fb88d0 100644
> --- a/eth-multiplexer/vdev.c
> +++ b/eth-multiplexer/vdev.c
> @@ -135,7 +135,10 @@ add_vdev (char *name, int size,
>
> vdev->dev_port = ports_get_right (vdev);
> ports_port_deref (vdev);
> - strncpy (vdev->name, name, IFNAMSIZ);
> + if (name)
> + strncpy (vdev->name, name, IFNAMSIZ);
> + else
> + vdev->name[0] = 0;
I assume the NULL case happens for the root node only?
Is this really useful?...
-antrik-