mlschroe commented on this pull request.
> @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev)
return res;
}
+static int getRotational(const char *dirName, dev_t dev)
+{
+ int rotational = 1; /* Be a good pessimist, assume the worst */
+#if defined(__linux__)
+ char *devpath = NULL;
+ FILE *f = NULL;
+
+ rasprintf(&devpath, "/sys/dev/block/%d:%d/queue/rotational",
+ major(dev), minor(dev));
+ if ((f = fopen(devpath, "r")) != NULL) {
+ int v;
+ if (fscanf(f, "%d", &v) == 1)
+ rotational = v;
That maybe the case with current kernels, but with kernel version 6.0.0 it will
probably return '-1' for some disks...
I'm just nitpicking because the rest of the code assumes that it returns a
boolean, which is not something fscanf guarantees. Feel free to ignore this
comment ;-)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/949#discussion_r381217245
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint