浏览代码

devmapper: Fix loopback mount code

Typo in the loop-control code made it always fall back to the
old method of opening loopback devices.
Alexander Larsson 12 年之前
父节点
当前提交
cc28829429
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      devmapper/devmapper.go

+ 1 - 1
devmapper/devmapper.go

@@ -27,7 +27,7 @@ attach_loop_device(const char *filename, int *loop_fd_out)
 
   start_index = 0;
   fd = open("/dev/loop-control", O_RDONLY);
-  if (fd == 0) {
+  if (fd >= 0) {
     start_index = ioctl(fd, LOOP_CTL_GET_FREE);
     close(fd);