From: Dan Pasanen Date: Tue, 6 Dec 2016 02:36:21 +0000 (-0600) Subject: Merge tag 'android-7.1.1_r4' into cm-14.1 X-Git-Tag: android-x86-7.1-r1~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9f276156d59fbb59291308e6539d994a4aa19de9;hp=-c;p=android-x86%2Fexternal-toybox.git Merge tag 'android-7.1.1_r4' into cm-14.1 Android 7.1.1 release 4 # gpg: Signature made Thu Dec 1 13:07:02 2016 CST # gpg: using DSA key E8AD3F819AB10E78 # gpg: Can't check signature: No public key --- 9f276156d59fbb59291308e6539d994a4aa19de9 diff --combined generated/globals.h index 9766963a,218792f0..ea2ea15b --- a/generated/globals.h +++ b/generated/globals.h @@@ -6,13 -6,6 +6,13 @@@ struct getprop_data struct selabel_handle *handle; }; +// toys/android/log.c + +struct log_data { + char *tag; + char *pri; +}; + // toys/example/hello.c struct hello_data { @@@ -46,12 -39,6 +46,12 @@@ struct dmesg_data long size; }; +// toys/lsb/hostname.c + +struct hostname_data { + char *fname; +}; + // toys/lsb/killall.c struct killall_data { @@@ -66,11 -53,6 +66,11 @@@ // toys/lsb/md5sum.c struct md5sum_data { + struct arg_list *c; + + int sawline; + + // Crypto variables blanked after summing unsigned state[5]; unsigned oldstate[5]; uint64_t count; @@@ -139,35 -121,6 +139,35 @@@ struct umount_data char *types; }; +// toys/net/ifconfig.c + +struct ifconfig_data { + int sockfd; +}; + +// toys/net/netcat.c + +struct netcat_data { + char *filename; // -f read from filename instead of network + long quit_delay; // -q Exit after EOF from stdin after # seconds. + char *source_address; // -s Bind to a specific source address. + long port; // -p Bind to a specific source port. + long wait; // -w Wait # seconds for a connection. +}; + +// toys/net/netstat.c + +struct netstat_data { + struct num_cache *inodes; + int wpad; +};; + +// toys/net/tunctl.c + +struct tunctl_data { + char *user; +}; + // toys/other/acpi.c struct acpi_data { @@@ -179,8 -132,6 +179,8 @@@ struct base64_data { long columns; + + unsigned total; }; // toys/other/blockdev.c @@@ -226,6 -177,12 +226,6 @@@ struct hwclock_data int utc; }; -// toys/other/ifconfig.c - -struct ifconfig_data { - int sockfd; -}; - // toys/other/ionice.c struct ionice_data { @@@ -303,6 -260,16 +303,6 @@@ struct modinfo_data long mod; }; -// toys/other/netcat.c - -struct netcat_data { - char *filename; // -f read from filename instead of network - long quit_delay; // -q Exit after EOF from stdin after # seconds. - char *source_address; // -s Bind to a specific source address. - long port; // -p Bind to a specific source port. - long wait; // -w Wait # seconds for a connection. -}; - // toys/other/nsenter.c struct nsenter_data { @@@ -316,12 -283,6 +316,12 @@@ struct oneit_data char *console; }; +// toys/other/setfattr.c + +struct setfattr_data { + char *x, *v, *n; +}; + // toys/other/shred.c struct shred_data { @@@ -341,8 -302,8 +341,8 @@@ struct stat_data struct stat st; struct statfs sf; } stat; - struct passwd *user_name; - struct group *group_name; + char *file, *pattern; + int patlen; }; // toys/other/swapon.c @@@ -383,7 -344,6 +383,7 @@@ struct truncate_data // toys/other/xxd.c struct xxd_data { + long s; long g; long l; long c; @@@ -432,12 -392,6 +432,12 @@@ struct brctl_data int sockfd; }; +// toys/pending/chrt.c + +struct chrt_data { + long pid; +}; + // toys/pending/compress.c struct compress_data { @@@ -481,18 -435,8 +481,18 @@@ struct crontab_data // toys/pending/dd.c struct dd_data { - int sig; -}; + int show_xfer; + int show_records; + unsigned long long bytes, c_count, in_full, in_part, out_full, out_part; + struct timeval start; + struct { + char *name; + int fd; + unsigned char *buff, *bp; + long sz, count; + unsigned long long offset; + } in, out; +};; // toys/pending/dhcp.c @@@ -550,9 -494,7 +550,9 @@@ struct dumpleases_data // toys/pending/expr.c struct expr_data { - int argidx; + char **tok; // current token, not on the stack since recursive calls mutate it + + char *refree; }; // toys/pending/fdisk.c @@@ -564,6 -506,12 +564,6 @@@ struct fdisk_data long cylinders; }; -// toys/pending/file.c - -struct file_data { - int max_name_len; -}; - // toys/pending/fold.c struct fold_data { @@@ -599,12 -547,6 +599,12 @@@ struct ftpget_data char buf[sizeof(struct sockaddr_storage)]; }; +// toys/pending/getfattr.c + +struct getfattr_data { + char *n; +}; + // toys/pending/getty.c struct getty_data { @@@ -693,11 -635,10 +693,11 @@@ struct logger_data // toys/pending/lsof.c struct lsof_data { - char *pids; + struct arg_list *p; struct stat *sought_files; + struct double_list *all_sockets; struct double_list *files; int last_shown_pid; int shown_header; @@@ -750,6 -691,13 +750,6 @@@ struct more_data int cin_fd; }; -// toys/pending/netstat.c - -struct netstat_data { - char current_name[21]; - int some_process_unidentified; -};; - // toys/pending/openvt.c struct openvt_data { @@@ -779,8 -727,6 +779,8 @@@ struct route_data struct sh_data { char *command; + + long lineno; }; // toys/pending/sulogin.c @@@ -943,12 -889,6 +943,12 @@@ struct watch_data int interval; }; +// toys/pending/wget.c + +struct wget_data { + char *filename; +}; + // toys/posix/chgrp.c struct chgrp_data { @@@ -1047,7 -987,7 +1047,7 @@@ struct df_data struct du_data { long maxdepth; - long depth, total; + unsigned long depth, total; dev_t st_dev; void *inodes; }; @@@ -1066,12 -1006,6 +1066,12 @@@ struct expand_data unsigned tabcount, *tab; }; +// toys/posix/file.c + +struct file_data { + int max_name_len; +}; + // toys/posix/find.c struct find_data { @@@ -1123,7 -1057,7 +1123,7 @@@ struct ls_data unsigned screen_width; int nl_title; - char uid_buf[12], gid_buf[12]; + char *escmore; }; // toys/posix/mkdir.c @@@ -1168,13 -1102,12 +1168,13 @@@ struct od_data struct arg_list *output_base; char *address_base; long max_count; + long width; long jump_bytes; int address_idx; unsigned types, leftover, star; - char *buf; - uint64_t bufs[4]; // force 64-bit alignment + char *buf; // Points to buffers[0] or buffers[1]. + char *bufs[2]; // Used to detect duplicate lines. off_t pos; }; @@@ -1189,7 -1122,6 +1189,7 @@@ struct paste_data struct patch_data { char *infile; long prefix; + char *dir; struct double_list *current_hunk; long oldline, oldlen, newline, newlen; @@@ -1223,9 -1155,8 +1223,9 @@@ struct ps_data struct arg_list *p; struct arg_list *o; struct arg_list *k; + struct arg_list *O; } top; - struct{ + struct { char *L; struct arg_list *G; struct arg_list *g; @@@ -1242,11 -1173,8 +1242,11 @@@ } pgrep; }; +#ifndef __APPLE__ struct sysinfo si; +#endif struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU; + struct dirtree *threadparent; unsigned width, height; dev_t tty; void *fields, *kfields; @@@ -1354,7 -1282,7 +1354,7 @@@ struct uudecode_data // toys/posix/wc.c struct wc_data { - unsigned long totals[3]; + unsigned long totals[4]; }; // toys/posix/xargs.c @@@ -1372,11 -1300,9 +1372,11 @@@ struct xargs_data extern union global_union { struct getprop_data getprop; + struct log_data log; struct hello_data hello; struct skeleton_data skeleton; struct dmesg_data dmesg; + struct hostname_data hostname; struct killall_data killall; struct md5sum_data md5sum; struct mknod_data mknod; @@@ -1387,10 -1313,6 +1387,10 @@@ struct seq_data seq; struct su_data su; struct umount_data umount; + struct ifconfig_data ifconfig; + struct netcat_data netcat; + struct netstat_data netstat; + struct tunctl_data tunctl; struct acpi_data acpi; struct base64_data base64; struct blockdev_data blockdev; @@@ -1399,6 -1321,7 +1399,6 @@@ struct free_data free; struct hexedit_data hexedit; struct hwclock_data hwclock; - struct ifconfig_data ifconfig; struct ionice_data ionice; struct login_data login; struct losetup_data losetup; @@@ -1408,9 -1331,9 +1408,9 @@@ struct mkpasswd_data mkpasswd; struct mkswap_data mkswap; struct modinfo_data modinfo; - struct netcat_data netcat; struct nsenter_data nsenter; struct oneit_data oneit; + struct setfattr_data setfattr; struct shred_data shred; struct stat_data stat; struct swapon_data swapon; @@@ -1422,7 -1345,6 +1422,7 @@@ struct arping_data arping; struct bootchartd_data bootchartd; struct brctl_data brctl; + struct chrt_data chrt; struct compress_data compress; struct crond_data crond; struct crontab_data crontab; @@@ -1434,10 -1356,10 +1434,10 @@@ struct dumpleases_data dumpleases; struct expr_data expr; struct fdisk_data fdisk; - struct file_data file; struct fold_data fold; struct fsck_data fsck; struct ftpget_data ftpget; + struct getfattr_data getfattr; struct getty_data getty; struct groupadd_data groupadd; struct host_data host; @@@ -1452,6 -1374,7 +1452,6 @@@ struct mke2fs_data mke2fs; struct modprobe_data modprobe; struct more_data more; - struct netstat_data netstat; struct openvt_data openvt; struct ping_data ping; struct route_data route; @@@ -1469,7 -1392,6 +1469,7 @@@ struct useradd_data useradd; struct vi_data vi; struct watch_data watch; + struct wget_data wget; struct chgrp_data chgrp; struct chmod_data chmod; struct cksum_data cksum; @@@ -1482,7 -1404,6 +1482,7 @@@ struct du_data du; struct env_data env; struct expand_data expand; + struct file_data file; struct find_data find; struct grep_data grep; struct head_data head; diff --combined toys/posix/du.c index 2797b3f4,115de52b..fad46a32 --- a/toys/posix/du.c +++ b/toys/posix/du.c @@@ -39,7 -39,7 +39,7 @@@ config D GLOBALS( long maxdepth; - long depth, total; + unsigned long depth, total; dev_t st_dev; void *inodes; ) @@@ -103,9 -103,11 +103,11 @@@ static int seen_inode(void **list, stru return 0; } - // dirtree callback, comput/display size of node + // dirtree callback, compute/display size of node static int do_du(struct dirtree *node) { + unsigned long blocks; + if (!node->parent) TT.st_dev = node->st.st_dev; else if (!dirtree_notdotdot(node)) return 0; @@@ -134,14 -136,19 +136,19 @@@ } else TT.depth--; } - node->extra += node->st.st_blocks; - if (node->parent) node->parent->extra += node->extra; + // Modern compilers' optimizers are insane and think signed overflow + // behaves differently than unsigned overflow. Sigh. Big hammer. + blocks = node->st.st_blocks + (unsigned long)node->extra; + node->extra = blocks; + if (node->parent) + node->parent->extra = (unsigned long)node->parent->extra+blocks; else TT.total += node->extra; if ((toys.optflags & FLAG_a) || !node->parent || (S_ISDIR(node->st.st_mode) && !(toys.optflags & FLAG_s))) { - print(node->extra*512, node); + blocks = node->extra; + print(blocks*512LL, node); } return 0; @@@ -153,7 -160,7 +160,7 @@@ void du_main(void // Loop over command line arguments, recursing through children for (args = toys.optc ? toys.optargs : noargs; *args; args++) - dirtree_handle_callback(dirtree_start(*args, toys.optflags&(FLAG_H|FLAG_L)), + dirtree_flagread(*args, DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)), do_du); if (toys.optflags & FLAG_c) print(TT.total*512, 0);