summaryrefslogtreecommitdiffstats
path: root/dosfstools/src/io.c
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2015-11-11 23:22:45 +0100
committerDees Troy <dees_troy@teamw.in>2015-11-26 05:09:55 +0100
commit18794c820f109e6de2e16af0f058b562b0492cbc (patch)
tree7792ad1809e62793ad5b1e86efd6d806d1368c36 /dosfstools/src/io.c
parentFree some memory allocations (diff)
downloadandroid_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar.gz
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar.bz2
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar.lz
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar.xz
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.tar.zst
android_bootable_recovery-18794c820f109e6de2e16af0f058b562b0492cbc.zip
Diffstat (limited to '')
-rw-r--r--dosfstools/src/io.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/dosfstools/src/io.c b/dosfstools/src/io.c
index a703c2db1..450432c8e 100644
--- a/dosfstools/src/io.c
+++ b/dosfstools/src/io.c
@@ -2,6 +2,7 @@
Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
+ Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
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
@@ -16,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
- On Debian systems, the complete text of the GNU General Public License
+ The complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.
*/
@@ -30,7 +31,6 @@
* by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
#define _LARGEFILE64_SOURCE
-#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -41,7 +41,7 @@
#include <fcntl.h>
#include <linux/fd.h>
-#include "dosfsck.h"
+#include "fsck.fat.h"
#include "common.h"
#include "io.h"
@@ -132,9 +132,11 @@ void fs_read(loff_t pos, int size, void *data)
if (walk->pos < pos + size && walk->pos + walk->size > pos) {
if (walk->pos < pos)
memcpy(data, (char *)walk->data + pos - walk->pos, min(size,
- walk->size
- - pos +
- walk->pos));
+ walk->
+ size -
+ pos +
+ walk->
+ pos));
else
memcpy((char *)data + walk->pos - pos, walk->data,
min(walk->size, size + pos - walk->pos));
@@ -220,7 +222,7 @@ int fs_close(int write)
changes = next;
}
if (close(fd) < 0)
- pdie("closing file system");
+ pdie("closing filesystem");
return changed || did_change;
}