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;

Should that be `rotational = v ? 1 : 0` or something like that?

-- 
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#pullrequestreview-361006475
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to