lxcfs/0026-lxcfs-fix-get-device-major-and-minor-number.patch

45 lines
1.1 KiB
Diff
Raw Normal View History

From b0ca5b7ead5891866b0bfec526beffce1095d749 Mon Sep 17 00:00:00 2001
From: zhangsong <zhangsong34@huawei.com>
Date: Wed, 24 Jun 2020 03:48:39 +0800
Subject: [PATCH] lxcfs: fix get device major and minor number
Signed-off-by: zhangsong <zhangsong34@huawei.com>
---
bindings.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings.c b/bindings.c
index 19cd57e..6e2ded5 100644
--- a/bindings.c
+++ b/bindings.c
@@ -26,7 +26,6 @@
#include <time.h>
#include <unistd.h>
#include <wait.h>
-#include <linux/kdev_t.h>
#include <linux/magic.h>
#include <linux/sched.h>
#include <sys/epoll.h>
@@ -37,6 +36,7 @@
#include <sys/syscall.h>
#include <sys/sysinfo.h>
#include <sys/vfs.h>
+#include <sys/sysmacros.h>
#include "bindings.h"
#include "config.h" // for VERSION
@@ -4146,8 +4146,8 @@ child_out:
}
end->next = NULL;
end->name = must_copy_string(dev_name);
- end->major = MAJOR(dev_num);
- end->minor = MINOR(dev_num);
+ end->major = major(dev_num);
+ end->minor = minor(dev_num);
}
err:
if (stream[0])
--
2.21.0