cocci: there's not ENOTSUP, there's only EOPNOTSUPP
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 12:41:33 +0000 (13:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jan 2018 14:12:16 +0000 (15:12 +0100)
On Linux the former is a compat alias to the latter, and that's really
weird, as inside the kernel the two are distinct. Which means we really
should stay away from it.

coccinelle/enotsup.cocci [new file with mode: 0644]
src/udev/net/ethtool-util.c

diff --git a/coccinelle/enotsup.cocci b/coccinelle/enotsup.cocci
new file mode 100644 (file)
index 0000000..c65734d
--- /dev/null
@@ -0,0 +1,4 @@
+@@
+@@
+- ENOTSUP
++ EOPNOTSUPP
index 1401584..9bdaef8 100644 (file)
@@ -401,7 +401,7 @@ static int get_glinksettings(int fd, struct ifreq *ifr, struct ethtool_link_uset
                 return -errno;
 
         if (ecmd.req.link_mode_masks_nwords >= 0 || ecmd.req.cmd != ETHTOOL_GLINKSETTINGS)
-                return -ENOTSUP;
+                return -EOPNOTSUPP;
 
         ecmd.req.link_mode_masks_nwords = -ecmd.req.link_mode_masks_nwords;
 
@@ -412,7 +412,7 @@ static int get_glinksettings(int fd, struct ifreq *ifr, struct ethtool_link_uset
                 return -errno;
 
         if (ecmd.req.link_mode_masks_nwords <= 0 || ecmd.req.cmd != ETHTOOL_GLINKSETTINGS)
-                return -ENOTSUP;
+                return -EOPNOTSUPP;
 
         u = new0(struct ethtool_link_usettings , 1);
         if (!u)