Skip to content

Commit

Permalink
Revert "dd: support skip and seek values greater than 2G on android"
Browse files Browse the repository at this point in the history
This reverts commit 6a025ba, breaks
dealing with large storages, and it's making simple operations like
"/dd if=/dev/zero of=/dev/block/mmcblk0p3 seek=6144 count=75 bs=1"
fail in recovery

Change-Id: I246072ea7e614ee19fc421a8b11f9d11504c9f45
  • Loading branch information
rmcc committed Oct 25, 2012
1 parent 5850222 commit 8ea3bb9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
16 changes: 1 addition & 15 deletions coreutils/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
int flags;
size_t oc;
off_t count;
uoff_t seek, skip;
off_t seek, skip;
const char *infile, *outfile;
} Z;
#define flags (Z.flags )
Expand Down Expand Up @@ -344,20 +344,6 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
} else {
outfile = bb_msg_standard_output;
}
#if (!ENABLE_LFS) && defined(ANDROID)
if (skip) {
if (lseek64(ifd, skip * ibs, SEEK_SET) == (off64_t) -1)
fprintf(stderr, "warning: skip lseek64 failed\n");
else
skip = 0;
}
if (seek) {
if (lseek64(ifd, seek * obs, SEEK_SET) == (off64_t) -1)
fprintf(stderr, "warning: seek lseek64 failed\n");
else
seek = 0;
}
#endif
if (skip) {
if (lseek(ifd, skip * ibs, SEEK_CUR) < 0) {
while (skip-- > 0) {
Expand Down
2 changes: 1 addition & 1 deletion include-full/applets.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ IF_DEPMOD(APPLET(depmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_INSMOD(APPLET(insmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_LSMOD(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODINFO(APPLET(modinfo, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_RMMOD(APPLET(rmmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_NBDCLIENT(APPLET_ODDNAME(nbd-client, nbdclient, BB_DIR_USR_SBIN, BB_SUID_DROP, nbdclient))
IF_PING(APPLET(ping, BB_DIR_BIN, BB_SUID_MAYBE))
Expand Down
2 changes: 1 addition & 1 deletion include-full/autoconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Automatically generated C config: don't edit
* Busybox version: 1.20.2-jb
*/
#define AUTOCONF_TIMESTAMP "2012-07-27 02:57 +0200"
#define AUTOCONF_TIMESTAMP "2012-10-25 21:29 +0100"

#define CONFIG_HAVE_DOT_CONFIG 1
#define ENABLE_HAVE_DOT_CONFIG 1
Expand Down
2 changes: 1 addition & 1 deletion include-minimal/applets.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ IF_DEPMOD(APPLET(depmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_INSMOD(APPLET(insmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_LSMOD(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODINFO(APPLET(modinfo, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe))
IF_MODPROBE(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
IF_RMMOD(APPLET(rmmod, BB_DIR_SBIN, BB_SUID_DROP))
IF_NBDCLIENT(APPLET_ODDNAME(nbd-client, nbdclient, BB_DIR_USR_SBIN, BB_SUID_DROP, nbdclient))
IF_PING(APPLET(ping, BB_DIR_BIN, BB_SUID_MAYBE))
Expand Down
2 changes: 1 addition & 1 deletion include-minimal/autoconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Automatically generated C config: don't edit
* Busybox version: 1.20.2-jb
*/
#define AUTOCONF_TIMESTAMP "2012-07-27 02:57 +0200"
#define AUTOCONF_TIMESTAMP "2012-10-25 21:29 +0100"

#define CONFIG_HAVE_DOT_CONFIG 1
#define ENABLE_HAVE_DOT_CONFIG 1
Expand Down

0 comments on commit 8ea3bb9

Please sign in to comment.