[bitbake-devel] Fix infinite loop while trying to lock file on name too long error

Submitted by Christophe PRIOUZEAU on April 17, 2020, 9:54 a.m. | Patch ID: 172010

Details

Message ID 20200417095407.8505-1-christophe.priouzeau@st.com
State New
Headers show

Commit Message

Christophe PRIOUZEAU April 17, 2020, 9:54 a.m.
During a call of lockfile the open go on error and generate an infinite
 loop of bitbake.

open("...._deploy_source_date_epoch.tgz.siginfo.lock", O_RDWR|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 ENAMETOOLONG (File name too long)

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
Signed-off-by: Christophe Guillon <christophe.guillon@st.com>
---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 5f5767c1d..f48a30dea 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -494,7 +494,7 @@  def lockfile(name, shared=False, retry=True, block=False):
                     return lf
             lf.close()
         except OSError as e:
-            if e.errno == errno.EACCES:
+            if e.errno == errno.EACCES or e.errno == errno.ENAMETOOLONG:
                 logger.error("Unable to acquire lock '%s', %s",
                              e.strerror, name)
                 sys.exit(1)