Loading toolbox/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ LOCAL_C_INCLUDES := bionic/libc/bionic LOCAL_CFLAGS += \ -std=gnu99 \ -Wno-unused-parameter \ -Werror -Wno-unused-parameter \ -include bsd-compatibility.h \ LOCAL_SHARED_LIBRARIES := \ Loading toolbox/cp/cp.c +2 −0 Original line number Diff line number Diff line Loading @@ -95,12 +95,14 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); #ifndef ANDROID static void progress(int sig __unused) { pinfo++; } #endif int cp_main(int argc, char *argv[]) Loading toolbox/cp/utils.c +9 −8 Original line number Diff line number Diff line Loading @@ -380,10 +380,11 @@ copy_special(struct stat *from_stat, int exists) int setfile(struct stat *fs, int fd) { int rval, islink; int rval = 0; #ifndef ANDROID int islink = S_ISLNK(fs->st_mode); #endif rval = 0; islink = S_ISLNK(fs->st_mode); fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; /* Loading toolbox/date.c +5 −8 Original line number Diff line number Diff line Loading @@ -145,9 +145,7 @@ int date_main(int argc, char *argv[]) struct tm tm; time_t t; struct timeval tv; struct timespec ts; char strbuf[260]; int fd; int useutc = 0; Loading Loading @@ -177,7 +175,6 @@ int date_main(int argc, char *argv[]) int hasfmt = argc == optind + 1 && argv[optind][0] == '+'; if(optind == argc || hasfmt) { char buf[2000]; time(&t); if (useutc) { gmtime_r(&t, &tm); Loading toolbox/dd.c +11 −11 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ dd_in(void) ++st.in_full; /* Handle full input blocks. */ } else if (n == in.dbsz) { } else if (n == (int64_t)in.dbsz) { in.dbcnt += in.dbrcnt = n; ++st.in_full; Loading Loading @@ -521,7 +521,7 @@ dd_out(int force) outp += nw; st.bytes += nw; if (nw == n) { if (n != out.dbsz) if (n != (int64_t)out.dbsz) ++st.out_part; else ++st.out_full; Loading Loading @@ -649,8 +649,8 @@ pos_in(void) void pos_out(void) { // struct mtop t_op; int cnt, n; /* struct mtop t_op; */ int64_t cnt, n; /* * If not a tape, try seeking on the file. Seeking on a pipe is Loading Loading @@ -681,7 +681,7 @@ pos_out(void) } /* Read it. */ for (cnt = 0; cnt < out.offset; ++cnt) { for (cnt = 0; cnt < (int64_t)out.offset; ++cnt) { if ((n = read(out.fd, out.db, out.dbsz)) > 0) continue; Loading @@ -705,8 +705,8 @@ pos_out(void) /* NOTREACHED */ } while (cnt++ < out.offset) if ((n = bwrite(out.fd, out.db, out.dbsz)) != out.dbsz) { while (cnt++ < (int64_t)out.offset) if ((n = bwrite(out.fd, out.db, out.dbsz)) != (int64_t)out.dbsz) { fprintf(stderr, "%s: cannot position " "by writing: %s\n", out.name, strerror(errno)); Loading Loading @@ -1153,7 +1153,7 @@ c_arg(const void *a, const void *b) ((const struct arg *)b)->name)); } static long long strsuftoll(const char* name, const char* arg, int def, unsigned int max) static long long strsuftoll(const char* name, const char* arg, int def, unsigned long long max) { long long result; Loading @@ -1180,7 +1180,7 @@ static void f_count(char *arg) { cpy_cnt = strsuftoll("block count", arg, 0, LLONG_MAX); cpy_cnt = (uint64_t)strsuftoll("block count", arg, 0, 0xFFFFFFFFFFFFFFFFULL); if (!cpy_cnt) terminate(0); } Loading Loading @@ -1228,14 +1228,14 @@ static void f_seek(char *arg) { out.offset = strsuftoll("seek blocks", arg, 0, LLONG_MAX); out.offset = (uint64_t)strsuftoll("seek blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL); } static void f_skip(char *arg) { in.offset = strsuftoll("skip blocks", arg, 0, LLONG_MAX); in.offset = (uint64_t)strsuftoll("skip blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL); } static void Loading Loading
toolbox/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ LOCAL_C_INCLUDES := bionic/libc/bionic LOCAL_CFLAGS += \ -std=gnu99 \ -Wno-unused-parameter \ -Werror -Wno-unused-parameter \ -include bsd-compatibility.h \ LOCAL_SHARED_LIBRARIES := \ Loading
toolbox/cp/cp.c +2 −0 Original line number Diff line number Diff line Loading @@ -95,12 +95,14 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); #ifndef ANDROID static void progress(int sig __unused) { pinfo++; } #endif int cp_main(int argc, char *argv[]) Loading
toolbox/cp/utils.c +9 −8 Original line number Diff line number Diff line Loading @@ -380,10 +380,11 @@ copy_special(struct stat *from_stat, int exists) int setfile(struct stat *fs, int fd) { int rval, islink; int rval = 0; #ifndef ANDROID int islink = S_ISLNK(fs->st_mode); #endif rval = 0; islink = S_ISLNK(fs->st_mode); fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; /* Loading
toolbox/date.c +5 −8 Original line number Diff line number Diff line Loading @@ -145,9 +145,7 @@ int date_main(int argc, char *argv[]) struct tm tm; time_t t; struct timeval tv; struct timespec ts; char strbuf[260]; int fd; int useutc = 0; Loading Loading @@ -177,7 +175,6 @@ int date_main(int argc, char *argv[]) int hasfmt = argc == optind + 1 && argv[optind][0] == '+'; if(optind == argc || hasfmt) { char buf[2000]; time(&t); if (useutc) { gmtime_r(&t, &tm); Loading
toolbox/dd.c +11 −11 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ dd_in(void) ++st.in_full; /* Handle full input blocks. */ } else if (n == in.dbsz) { } else if (n == (int64_t)in.dbsz) { in.dbcnt += in.dbrcnt = n; ++st.in_full; Loading Loading @@ -521,7 +521,7 @@ dd_out(int force) outp += nw; st.bytes += nw; if (nw == n) { if (n != out.dbsz) if (n != (int64_t)out.dbsz) ++st.out_part; else ++st.out_full; Loading Loading @@ -649,8 +649,8 @@ pos_in(void) void pos_out(void) { // struct mtop t_op; int cnt, n; /* struct mtop t_op; */ int64_t cnt, n; /* * If not a tape, try seeking on the file. Seeking on a pipe is Loading Loading @@ -681,7 +681,7 @@ pos_out(void) } /* Read it. */ for (cnt = 0; cnt < out.offset; ++cnt) { for (cnt = 0; cnt < (int64_t)out.offset; ++cnt) { if ((n = read(out.fd, out.db, out.dbsz)) > 0) continue; Loading @@ -705,8 +705,8 @@ pos_out(void) /* NOTREACHED */ } while (cnt++ < out.offset) if ((n = bwrite(out.fd, out.db, out.dbsz)) != out.dbsz) { while (cnt++ < (int64_t)out.offset) if ((n = bwrite(out.fd, out.db, out.dbsz)) != (int64_t)out.dbsz) { fprintf(stderr, "%s: cannot position " "by writing: %s\n", out.name, strerror(errno)); Loading Loading @@ -1153,7 +1153,7 @@ c_arg(const void *a, const void *b) ((const struct arg *)b)->name)); } static long long strsuftoll(const char* name, const char* arg, int def, unsigned int max) static long long strsuftoll(const char* name, const char* arg, int def, unsigned long long max) { long long result; Loading @@ -1180,7 +1180,7 @@ static void f_count(char *arg) { cpy_cnt = strsuftoll("block count", arg, 0, LLONG_MAX); cpy_cnt = (uint64_t)strsuftoll("block count", arg, 0, 0xFFFFFFFFFFFFFFFFULL); if (!cpy_cnt) terminate(0); } Loading Loading @@ -1228,14 +1228,14 @@ static void f_seek(char *arg) { out.offset = strsuftoll("seek blocks", arg, 0, LLONG_MAX); out.offset = (uint64_t)strsuftoll("seek blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL); } static void f_skip(char *arg) { in.offset = strsuftoll("skip blocks", arg, 0, LLONG_MAX); in.offset = (uint64_t)strsuftoll("skip blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL); } static void Loading