1 Star 0 Fork 68

hexiaole1994/util-linux

forked from src-openEuler/util-linux 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Forward-value-of-sector_size-instead-of-its-address.patch 781 Bytes
一键复制 编辑 原始数据 按行查看 历史
shangyibin 提交于 2022-06-20 17:29 +08:00 . sync patches
From 9b1d5d040d82db567c9ab0ea2b271b6d12e8969f Mon Sep 17 00:00:00 2001
From: Nicolas Melot <nicolas.melot@ericsson.com>
Date: Sun, 1 Aug 2021 19:20:58 +0200
Subject: [PATCH] Forward value of sector_size instead of its address in
blkdev_get_physector_size
---
lib/blkdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/blkdev.c b/lib/blkdev.c
index c22853d..2d02fb8 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -222,8 +222,10 @@ int blkdev_get_sector_size(int fd __attribute__((__unused__)), int *sector_size)
#ifdef BLKPBSZGET
int blkdev_get_physector_size(int fd, int *sector_size)
{
- if (ioctl(fd, BLKPBSZGET, &sector_size) >= 0)
+ if (ioctl(fd, BLKPBSZGET, sector_size) >= 0)
+ {
return 0;
+ }
return -1;
}
#else
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hexiaole1994/util-linux.git
git@gitee.com:hexiaole1994/util-linux.git
hexiaole1994
util-linux
util-linux
master

搜索帮助