diff --git a/configure.in b/configure.in
index 71f3294e945a57f5a4bdecfb54d62eb54cf1559f..053f3bd9c5c03eb7f4145ee77c056d5cb6d8e9a3 100644
--- a/configure.in
+++ b/configure.in
@@ -16,6 +16,7 @@ AC_CHECK_HEADERS(
 
 # Check for typedefs, structures, and compiler characteristics.
 AC_TYPE_INT64_T
+AC_TYPE_UINT64_T
 AC_SYS_LARGEFILE
 AC_STRUCT_ST_BLOCKS
 
diff --git a/src/dir_scan.c b/src/dir_scan.c
index e7ee5d8170608ffb07ae480c03587ee9558bc7b8..4b07ed5a05c79b6853deffe1fa53a121f82aecbf 100644
--- a/src/dir_scan.c
+++ b/src/dir_scan.c
@@ -49,7 +49,7 @@ static dev_t curdev;   /* current device we're scanning on */
 /* Populates the struct dir item with information from the stat struct. Sets
  * everything necessary for output_dir.item() except FF_ERR and FF_EXL. */
 static void stat_to_dir(struct dir *d, struct stat *fs) {
-  d->ino = fs->st_ino;
+  d->ino = (uint64_t)fs->st_ino;
   d->dev = fs->st_dev;
 
   if(S_ISREG(fs->st_mode))
diff --git a/src/global.h b/src/global.h
index e1f273e305573a623d8d48ebe9eb61920058b7a4..7737204a755bf42a1a7156a0058cfb8149776cd6 100644
--- a/src/global.h
+++ b/src/global.h
@@ -61,7 +61,7 @@
 struct dir {
   struct dir *parent, *next, *prev, *sub, *hlnk;
   int64_t size, asize;
-  ino_t ino;
+  uint64_t ino;
   int items;
   dev_t dev;
   unsigned char flags;