Btrfs-progs: don't close the file descriptor 0 when closing a device
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Jul 2013 13:25:10 +0000 (21:25 +0800)
committerChris Mason <chris.mason@fusionio.com>
Wed, 3 Jul 2013 18:06:54 +0000 (14:06 -0400)
commit0daa219ee1119e30059077da5be03c4506963fe2
tree7fc42861f945e853321147bf7a4a0f0e556ef270
parent32a8c1dd905714e91b7d590aa7d833c475e737d4
Btrfs-progs: don't close the file descriptor 0 when closing a device

As we know, the file descriptor 0 is a special number, so we shouldn't
use it to initialize the file descriptor of the devices, or we might
close this special file descriptor by mistake when we close the devices.
"-1" is a better choice.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-find-root.c
disk-io.c
volumes.c