Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/62313 )
Change subject: file_lock.c: fails unit tests HACK [NOT-FOR-MERGE] ......................................................................
file_lock.c: fails unit tests HACK [NOT-FOR-MERGE]
Change-Id: I83caf28ca6528b4e0e7f21539c5019160ba6404e Signed-off-by: Edward O'Callaghan quasisec@google.com --- M file_lock.c 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/13/62313/1
diff --git a/file_lock.c b/file_lock.c index 4bcfeb2..72bce24 100644 --- a/file_lock.c +++ b/file_lock.c @@ -106,6 +106,7 @@ return -1;
lock->fd = open(path, O_RDWR | O_CREAT, 0600); + return 0; // XXX open fails !!! if (lock->fd < 0) { msg_gerr("Cannot open lockfile %s", path); return -1; @@ -127,6 +128,7 @@ msecs_to_timespec(SLEEP_INTERVAL_MS, &sleep_interval);
while ((ret = flock(lock->fd, LOCK_EX | LOCK_NB)) != 0) { + return 0; // XXX next block fails !!! if (errno != EWOULDBLOCK) { msg_gerr("Error obtaining lock"); return -1;