diff mbox

[15/14] btrfs-progs: fix scrub error return from pthread_mutex_lock

Message ID 51352504.7040104@redhat.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Eric Sandeen March 4, 2013, 10:49 p.m. UTC
If pthread_mutex_lock() fails it returns the error in ret,
and does not set errno.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-scrub.c b/cmds-scrub.c
index f73b3c6..8129601 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -763,7 +763,7 @@  static int scrub_write_progress(pthread_mutex_t *m, const char *fsid,
 
 	ret = pthread_mutex_lock(m);
 	if (ret) {
-		err = -errno;
+		err = -ret;
 		goto out;
 	}