From: Ben Pfaff Date: Thu, 16 Apr 2009 21:43:47 +0000 (-0700) Subject: datapath: Fix build on 2.6.18, which doesn't have "bool" or "false". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22f261af910d18862111dd31b97117bcc830ba95;p=openvswitch datapath: Fix build on 2.6.18, which doesn't have "bool" or "false". The "bool" type is a relative newcomer to the Linux kernel, and it is still frowned up by some developers, so instead of adding a definition to our compatibility headers (which is what we usually do), this commit changes "bool" to "int". --- diff --git a/datapath/brcompat.c b/datapath/brcompat.c index 926e8d35..e20af016 100644 --- a/datapath/brcompat.c +++ b/datapath/brcompat.c @@ -308,14 +308,14 @@ static struct genl_ops brc_genl_ops_dp_result = { .dumpit = NULL }; -bool dp_exists(const char *dp_name) +int dp_exists(const char *dp_name) { struct net_device *dev; - bool retval; + int retval; dev = dev_get_by_name(&init_net, dp_name); if (!dev) - return false; + return 0; retval = is_dp_dev(dev); dev_put(dev); @@ -362,7 +362,7 @@ int brc_send_dp_add_del(const char *dp_name, int add) * reconfigure itself. We need to make sure the changes actually * worked. */ for (i = 0; i < 50; i++) { - bool exists = dp_exists(dp_name); + int exists = dp_exists(dp_name); if ((add && exists) || (!add && !exists)) return 0;