diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-09-02 20:22:30 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-09-02 18:56:54 +0200 |
commit | 8c6d4e6c7cb787d20f99b5c3c591b76e687b9483 (patch) | |
tree | 3373e921c6bbc3fc79a8592643564d0179949a44 /chunk-recover.c | |
parent | 1593aa711a8578008833d634ce0a04f97dd4a837 (diff) |
btrfs-progs: Use long type to get thread's return value
pthread use void * to save return status, we can use this pointer to
save our return value, but we need to keep the same length.
This patch move to use long type variable to save return value
of our thread, to avoid potential invalid memory access.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'chunk-recover.c')
-rw-r--r-- | chunk-recover.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chunk-recover.c b/chunk-recover.c index 3f674328..576a2a68 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -831,7 +831,7 @@ static int scan_devices(struct recover_control *rc) struct btrfs_device *dev; struct device_scan *dev_scans; pthread_t *t_scans; - int *t_rets; + long *t_rets; int devnr = 0; int devidx = 0; int cancel_from = 0; @@ -847,7 +847,7 @@ static int scan_devices(struct recover_control *rc) t_scans = (pthread_t *)malloc(sizeof(pthread_t) * devnr); if (!t_scans) return -ENOMEM; - t_rets = (int *)malloc(sizeof(int) * devnr); + t_rets = (long *)malloc(sizeof(long) * devnr); if (!t_rets) return -ENOMEM; |