From f6f4c01bb9a68028ffe452c9c1a611d45098f1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Wed, 18 Mar 2015 15:18:10 +0100 Subject: RRO: idmap: allow flock(2) to block During creation of an idmap an advisory lock is applied on the output file using flock(2). This commit removes the LOCK_NB flag from the call to flock(2). The reason for this is that if the function were to return EWOULDBLOCK, the entire idmap operation would be aborted leading to the device booting without the correct overlay packages applied. Change-Id: Iad319779976e950d4354e4f60b30439f6f208b77 --- cmds/idmap/create.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp index f706533..dd0554e 100644 --- a/cmds/idmap/create.cpp +++ b/cmds/idmap/create.cpp @@ -42,7 +42,7 @@ namespace { ALOGD("error: fchmod %s: %s\n", path, strerror(errno)); goto fail; } - if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) { + if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX)) != 0) { ALOGD("error: flock %s: %s\n", path, strerror(errno)); // If the file is locked by another process, then we needn't unlink the file. needUnlink = false; -- cgit v1.1