[OE-core] [PATCH 2/2] sanity: Don't hard code value of ENAMETOOLONG

Mike Crowe mac at mcrowe.com
Mon Nov 25 15:20:15 UTC 2013


Although ENAMETOOLONG is 36 on Linux x86 and x86_64 it does isn't on other
architectures so the value shouldn't be hard coded.

Signed-off-by: Mike Crowe <mac at mcrowe.com>
---
 meta/classes/sanity.bbclass |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 0d40792..8531df1 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -184,8 +184,9 @@ def check_create_long_filename(filepath, pathname):
         f.close()
         os.remove(testfile)
     except IOError as e:
-        errno, strerror = e.args
-        if errno == 36: # ENAMETOOLONG
+        import errno
+        err, strerror = e.args
+        if err == errno.ENAMETOOLONG:
             return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
         else:
             return "Failed to create a file in %s: %s.\n" % (pathname, strerror)
-- 
1.7.10.4




More information about the Openembedded-core mailing list