mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-02 19:52:02 +00:00
btrfs-progs: Set info->periodic.timer_fd to 0 in init-fail
In current code, (info->periodic.timer_fd == 0) means it is not valid, as: if (info->periodic.timer_fd) { close(info->periodic.timer_fd); ... We need set its value from -1 to 0 in create-fail case, to make code like above works. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f156337dc8
commit
cb3424cd23
@ -94,8 +94,10 @@ int task_period_start(struct task_info *info, unsigned int period_ms)
|
||||
return -1;
|
||||
|
||||
info->periodic.timer_fd = timerfd_create(CLOCK_MONOTONIC, 0);
|
||||
if (info->periodic.timer_fd == -1)
|
||||
if (info->periodic.timer_fd == -1) {
|
||||
info->periodic.timer_fd = 0;
|
||||
return info->periodic.timer_fd;
|
||||
}
|
||||
|
||||
info->periodic.wakeups_missed = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user