btrfs-progs: fix scrub error return from pthread_mutex_lock
authorEric Sandeen <sandeen@redhat.com>
Mon, 4 Mar 2013 22:49:40 +0000 (16:49 -0600)
committerDavid Sterba <dsterba@suse.cz>
Sun, 10 Mar 2013 15:06:37 +0000 (16:06 +0100)
If pthread_mutex_lock() fails it returns the error in ret,
and does not set errno.

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

index 91ace9c..b0fcde6 100644 (file)
@@ -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;
        }