From: Mike Crowe Date: Mon, 25 Nov 2013 15:20:15 +0000 (+0000) Subject: sanity: Don't hard code value of ENAMETOOLONG X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~35339 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11a9cf5ee0daf82097fb2f36b58016f20a5968f3;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git sanity: Don't hard code value of ENAMETOOLONG 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 6807a231520..b26ea6b3727 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -183,8 +183,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)