[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Support devices larger than 1.5TB (#649095, rspanton AT zepler DOT net).



---
 pyanaconda/isys/devices.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/isys/devices.c b/pyanaconda/isys/devices.c
index a30f006..869614e 100644
--- a/pyanaconda/isys/devices.c
+++ b/pyanaconda/isys/devices.c
@@ -90,7 +90,7 @@ struct device **getDevices(enum deviceType type) {
                 continue;
 
             if (devtype == DEVICE_DISK && !(caps & GENHD_FL_REMOVABLE)) {
-                int size;
+                long long int size;
 
                 snprintf(path, 64, "/sys/block/%s/size", ent->d_name);
                 fd = open(path, O_RDONLY);
@@ -104,10 +104,10 @@ struct device **getDevices(enum deviceType type) {
 
                 close(fd);
                 errno = 0;
-                size = strtol(buf, NULL, 10);
+                size = strtoll(buf, NULL, 10);
 
-                if ((errno == ERANGE && (size == LONG_MIN ||
-                                         size == LONG_MAX)) ||
+                if ((errno == ERANGE && (size == LLONG_MIN ||
+                                         size == LLONG_MAX)) ||
                     (errno != 0 && size == 0)) {
                     return NULL;
                 }
-- 
1.7.1.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]