commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 01/75: pfinet: fix sanity check at translator startup time


From: Samuel Thibault
Subject: [hurd] 01/75: pfinet: fix sanity check at translator startup time
Date: Thu, 14 Jan 2016 01:04:01 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch dde
in repository hurd.

commit d9a22b92a226419c50fd13013741679ce7e7b624
Author: Justus Winter <address@hidden>
Date:   Tue Nov 3 22:44:07 2015 +0100

    pfinet: fix sanity check at translator startup time
    
    * pfinet/main.c (main): Properly iterate over `pfinet_protid_portclasses'.
---
 pfinet/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pfinet/main.c b/pfinet/main.c
index 46457a9..4bfa318 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -269,6 +269,8 @@ extern void sk_init (void), skb_init (void);
 extern int net_dev_init (void);
 extern void inet6_proto_init (struct net_proto *pro);
 
+#define ARRAY_SIZE(x)       (sizeof(x) / sizeof((x)[0]))
+
 int
 main (int argc,
       char **argv)
@@ -374,11 +376,11 @@ main (int argc,
     int i;
     /* Check that at least one portclass has been bound, 
        error out otherwise. */
-    for (i = 0; i < trivfs_protid_nportclasses; i ++)
+    for (i = 0; i < ARRAY_SIZE (pfinet_protid_portclasses); i++)
       if (pfinet_protid_portclasses[i] != MACH_PORT_NULL)
        break;
 
-    if (i == trivfs_protid_nportclasses)
+    if (i == ARRAY_SIZE (pfinet_protid_portclasses))
       error (1, 0, "should be started as a translator.\n");
   }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]