summaryrefslogtreecommitdiffstats
path: root/exfat/fsck
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2015-12-13 18:29:45 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-12-23 16:56:56 +0100
commit09ef1e410970b74df384047fcf4c0e18a6ec3643 (patch)
tree6e88024c45cfb5a66220f2910f853e774f07fb16 /exfat/fsck
parentexfat: Build fsck and update path to mkfs (diff)
downloadandroid_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar.gz
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar.bz2
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar.lz
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar.xz
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.tar.zst
android_bootable_recovery-09ef1e410970b74df384047fcf4c0e18a6ec3643.zip
Diffstat (limited to 'exfat/fsck')
-rw-r--r--exfat/fsck/Android.mk8
-rw-r--r--exfat/fsck/exfatfsck.82
-rw-r--r--exfat/fsck/main.c23
3 files changed, 17 insertions, 16 deletions
diff --git a/exfat/fsck/Android.mk b/exfat/fsck/Android.mk
index 2cada95f5..5ad03028f 100644
--- a/exfat/fsck/Android.mk
+++ b/exfat/fsck/Android.mk
@@ -1,16 +1,16 @@
LOCAL_PATH := $(call my-dir)
-
include $(CLEAR_VARS)
LOCAL_MODULE := fsckexfat
LOCAL_MODULE_STEM := fsck.exfat
+LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64
LOCAL_SRC_FILES = main.c
LOCAL_C_INCLUDES += $(LOCAL_PATH) \
- $(commands_recovery_local_path)/exfat/libexfat \
- $(commands_recovery_local_path)/fuse/include
-LOCAL_SHARED_LIBRARIES += libexfat_twrp
+ $(commands_recovery_local_path)/exfat/libexfat \
+ $(commands_recovery_local_path)/fuse/include
+LOCAL_SHARED_LIBRARIES := libexfat_twrp
include $(BUILD_EXECUTABLE)
diff --git a/exfat/fsck/exfatfsck.8 b/exfat/fsck/exfatfsck.8
index 40d7c85f5..e95048845 100644
--- a/exfat/fsck/exfatfsck.8
+++ b/exfat/fsck/exfatfsck.8
@@ -1,4 +1,4 @@
-.\" Copyright (C) 2011 Andrew Nayenko
+.\" Copyright (C) 2011-2015 Andrew Nayenko
.\"
.TH EXFATFSCK 8 "February 2011"
.SH NAME
diff --git a/exfat/fsck/main.c b/exfat/fsck/main.c
index 91f754594..ded76b20c 100644
--- a/exfat/fsck/main.c
+++ b/exfat/fsck/main.c
@@ -3,7 +3,7 @@
exFAT file system checker.
Free exFAT implementation.
- Copyright (C) 2011-2013 Andrew Nayenko
+ Copyright (C) 2011-2015 Andrew Nayenko
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,10 +20,9 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <exfat.h>
#include <stdio.h>
#include <string.h>
-#include <exfat.h>
-#include <exfatfs.h>
#include <inttypes.h>
#include <unistd.h>
@@ -45,7 +44,7 @@ static int nodeck(struct exfat* ef, struct exfat_node* node)
char name[UTF8_BYTES(EXFAT_NAME_MAX) + 1];
exfat_get_name(node, name, sizeof(name) - 1);
- exfat_error("file `%s' has invalid cluster 0x%x", name, c);
+ exfat_error("file '%s' has invalid cluster 0x%x", name, c);
rc = 1;
break;
}
@@ -54,7 +53,7 @@ static int nodeck(struct exfat* ef, struct exfat_node* node)
char name[UTF8_BYTES(EXFAT_NAME_MAX) + 1];
exfat_get_name(node, name, sizeof(name) - 1);
- exfat_error("cluster 0x%x of file `%s' is not allocated", c, name);
+ exfat_error("cluster 0x%x of file '%s' is not allocated", c, name);
rc = 1;
}
c = exfat_next_cluster(ef, node, c);
@@ -72,16 +71,20 @@ static void dirck(struct exfat* ef, const char* path)
char* entry_path;
if (exfat_lookup(ef, &parent, path) != 0)
- exfat_bug("directory `%s' is not found", path);
+ exfat_bug("directory '%s' is not found", path);
if (!(parent->flags & EXFAT_ATTRIB_DIR))
- exfat_bug("`%s' is not a directory (0x%x)", path, parent->flags);
+ exfat_bug("'%s' is not a directory (0x%x)", path, parent->flags);
if (nodeck(ef, parent) != 0)
+ {
+ exfat_put_node(ef, parent);
return;
+ }
path_length = strlen(path);
entry_path = malloc(path_length + 1 + UTF8_BYTES(EXFAT_NAME_MAX) + 1);
if (entry_path == NULL)
{
+ exfat_put_node(ef, parent);
exfat_error("out of memory");
return;
}
@@ -93,7 +96,6 @@ static void dirck(struct exfat* ef, const char* path)
{
free(entry_path);
exfat_put_node(ef, parent);
- exfat_error("failed to open directory `%s'", path);
return;
}
while ((node = exfat_readdir(ef, &it)))
@@ -138,15 +140,14 @@ int main(int argc, char* argv[])
const char* spec = NULL;
struct exfat ef;
- printf("exfatfsck %u.%u.%u\n",
- EXFAT_VERSION_MAJOR, EXFAT_VERSION_MINOR, EXFAT_VERSION_PATCH);
+ printf("exfatfsck %s\n", VERSION);
while ((opt = getopt(argc, argv, "V")) != -1)
{
switch (opt)
{
case 'V':
- puts("Copyright (C) 2011-2013 Andrew Nayenko");
+ puts("Copyright (C) 2011-2015 Andrew Nayenko");
return 0;
default:
usage(argv[0]);