From 79b1b57045e86d9845e352c3f2aa0efbab6111a9 Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 14 3月 2020 10:19:09 +0800
Subject: [PATCH] tests and improvements

---
 src/library/os/linux/os-linux.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/library/os/linux/os-linux.c b/src/library/os/linux/os-linux.c
index 1dc23cb..57fb028 100644
--- a/src/library/os/linux/os-linux.c
+++ b/src/library/os/linux/os-linux.c
@@ -111,7 +111,9 @@
 				if (strcmp(ent->mnt_dir, "/") == 0) {
 					strcpy(tmpDrives[drive_found].label, "root");
 					LOG_DEBUG("drive %s set to preferred\n", ent->mnt_fsname);
-					tmpDrives[drive_found].preferred = true;
+					tmpDrives[drive_found].preferred = 1;
+				} else {
+					tmpDrives[drive_found].preferred = 0;
 				}
 			}
 		}
@@ -169,22 +171,6 @@
 	} else {
 		result = FUNC_RET_BUFFER_TOO_SMALL;
 	}
-	/*
-	 FILE *mounts = fopen(_PATH_MOUNTED, "r");
-	 if (mounts == NULL) {
-	 return ERROR;
-	 }
-
-	 while (fscanf(mounts, "%64s %64s %64s %1024[^\n]", device, name, type,
-	 discard) != EOF) {
-	 if (stat(device, &mount_stat) != 0)
-	 continue;
-	 if (filename_stat.st_dev == mount_stat.st_rdev) {
-	 fprintf(stderr, "device: %s; name: %s; type: %s\n", device, name,
-	 type);
-	 }
-	 }
-	 */
 	free(statDrives);
 	return result;
 }

--
Gitblit v1.9.1