Re: [Toybox] [PATCH] tr: fix pathological flushing.

2020-12-05 Thread Josh Gao via Toybox
On Sat, Dec 5, 2020, 3:38 AM Rob Landley wrote: > (Also, line buffering sucks because it'll flush at the buffer size anyway > so > you're not guaranteed to get a full line of contiguous output. What it > REALLY > wants is nagle's algorithm for stdout but no libc ever bothered to > IMPLEMENT it,

Re: [Toybox] llvm regression test.

2020-05-04 Thread Josh Gao via Toybox
On Mon, May 4, 2020 at 2:57 PM Rob Landley wrote: > What portion of this script does what when? Right, assuming all the bisect > stuff > is ignorable and the command line editing isn't relevant, where's the real > binary it passes through to? > > $ find clang-r377782d -name clang | xargs file >

Re: [Toybox] [PATCH] losetup: fix the race.

2019-08-08 Thread Josh Gao via Toybox
On Wed, Aug 7, 2019 at 8:59 AM enh via Toybox wrote: > iirc, the adb maintainer has similar problems where when you first > connect an Android device to a Linux host, it shows up but with the > wrong permissions which then fix themselves if you wait+retry. which > for my money is even worse. (but

Re: [Toybox] setenv memory leak.

2019-04-08 Thread Josh Gao via Toybox
On Mon, Apr 8, 2019 at 1:12 PM Rob Landley wrote: > Yes, they have to do it themselves because libc is doing it unusably wrong for > anything that persists and changes environment variables repeatedly. > > *shrug* Reinventing this wheel isn't hard, I'd just hoped I wouldn't have to. > But I

Re: [Toybox] NDK versions?

2019-03-08 Thread Josh Gao via Toybox
On Fri, Mar 8, 2019 at 12:34 PM Rob Landley wrote: > > What would be really really nice is if you had -cc and -c++ symlinks to the > latest -clang and -clang++ versions in the zip file. Then I wouldn't have to > create them, so I wouldn't have to work out which version is latest. (You > could >

Re: [Toybox] [PATCH] nc: allow immediate reuse of ports

2019-01-25 Thread Josh Gao via Toybox
Whoops, missed that. Another patch attached. On Fri, Jan 25, 2019 at 6:49 AM Rob Landley wrote: > On 1/24/19 7:38 PM, Josh Gao via Toybox wrote: > > Set SO_REUSEADDR when listening so that we can immediately reuse ports > > that are no longer being listened upon, instead of ha

[Toybox] [PATCH] nc: allow immediate reuse of ports

2019-01-24 Thread Josh Gao via Toybox
: Josh Gao Date: Thu, 24 Jan 2019 17:32:35 -0800 Subject: [PATCH] nc: allow immediate reuse of ports. Set SO_REUSEADDR when listening so that we can immediately reuse ports that are no longer being listened upon, instead of having to wait 60 seconds for the socket to be shutdown after being closed

[Toybox] [PATCH] Fix `netcat -l -p 12345`.

2019-01-02 Thread Josh Gao via Toybox
Previously, when trying to listen on a socket without using one of -4, -6, or -s, we tried to create an AF_UNSPEC socket, which fails. --- toys/net/netcat.c | 4 1 file changed, 4 insertions(+) diff --git a/toys/net/netcat.c b/toys/net/netcat.c index 761d1f2a..57304f44 100644 ---

[Toybox] [PATCH] nc: IPv6, -4/-6, UDP

2018-12-10 Thread Josh Gao via Toybox
I sent some patches to add these a year ago, and the people requesting the functionality probably just hit the same point in their development cycle where they're wanting this again :-) From 0f431a44804920a693e8832dbc784b70f227318a Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 10 Dec 2018 16

Re: [Toybox] Warning: gcc can't tell this is never used uninitialized, but llvm can.

2018-10-30 Thread Josh Gao
On Tue, Oct 30, 2018 at 10:05 AM Rob Landley wrote: > On 10/30/18 11:40 AM, Rob Landley wrote: > > And the three warnings gcc produces (but llvm doesn't), the larger todo > item for > > which is to figure out what to do about the "int x = x;" stuff, > > Ooh, spoke too soon. The gcc guys _did_

Re: [Toybox] ls (/-b/-q) (/on a tty)

2017-12-08 Thread Josh Gao
On Fri, Dec 8, 2017 at 6:12 PM, Rob Landley wrote: > > I dunno about "wrong", but I agree it's not what ubuntu's does. > Posix-2008 is ambivalent: > > -q Force each instance of non-printable filename characters and >characters to be written as the ( '?' ) >

Re: [Toybox] [PATCH] netcat: make -l exit after handling a request

2017-07-18 Thread Josh Gao
Sorry for pestering, but have you gotten a chance to take a look at these yet? We're starting to grow dependencies on some of these patches (tests that want to be checked in Soon are being written against a checkout with the patches manually applied) On Fri, Jun 30, 2017 at 12:17 PM, Josh Gao <

Re: [Toybox] [PATCH] netcat: make -l exit after handling a request

2017-06-30 Thread Josh Gao
gs > they actually need right now.) > > On Wed, Jun 28, 2017 at 3:47 PM, Josh Gao <jm...@google.com> wrote: > > On Sun, Jun 25, 2017 at 12:14 PM, Rob Landley <r...@landley.net> wrote: > >> > >> 1) switching it to use xconnect() which it predates, and which

Re: [Toybox] [PATCH] netcat: make -l exit after handling a request

2017-06-28 Thread Josh Gao
u pass in resolves to multiple addresses? OpenBSD's netcat seems to just bind the first compatible address it resolves to, so we can maybe just ignore this.) -Josh From cd3a377366ed25dcdb821559b39b8319b65eabf0 Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Wed, 28 Jun 2017

Re: [Toybox] [PATCH] netcat: make -l exit after handling a request

2017-06-26 Thread Josh Gao
On Sun, Jun 25, 2017 at 12:14 PM, Rob Landley wrote: > > > terminal1$ echo foo | toybox nc -l -p 1234 > bar > > terminal1$ cat bar > > bar > > Your call there wouldn't work with the "stop after -l" version either, > the -p would have to come before the -l. :P Seems

Re: [Toybox] [PATCH] netcat: make -l exit after handling a request

2017-06-09 Thread Josh Gao
On Fri, Jun 9, 2017 at 1:31 PM, Rob Landley <r...@landley.net> wrote: > On 06/09/2017 01:05 PM, Josh Gao wrote: > > Patch attached. > > What specifically did you fix? (I.E. is this the same "netcat -L > zombies" issue I have on my todo list?) > This

[Toybox] [PATCH] netcat: make -l exit after handling a request

2017-06-09 Thread Josh Gao
Patch attached. From eceb0b80dcce8a0d20f05b4a47b2e1a69be9b9c9 Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Fri, 9 Jun 2017 10:51:18 -0700 Subject: [PATCH] netcat: make -l exit after handling a request. Bug: http://b/62305466 --- toys/net/netcat.c | 17 --

Re: [Toybox] [PATCH] Fix various seq bugs.

2017-05-23 Thread Josh Gao
On Mon, May 22, 2017 at 11:54 PM, Rob Landley wrote: > > What's the use case for this code? Did they notice a difference from gnu > and say "any difference is a bug", or was somebody actually trying to do > something that broke? > The surprising behavior that I ran into was

[Toybox] [PATCH] ps: don't query for terminal size if not a tty

2017-03-27 Thread Josh Gao
hed to check isatty(1) before getting the terminal size. From 2f289334ba5d262080a9da1186f0530a5aec1c79 Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Mon, 27 Mar 2017 15:53:03 -0700 Subject: [PATCH] ps: don't query for terminal size if not a tty. `ps -A | cat` shouldn't have

Re: [Toybox] [PATCH] Make chmod work on . and ..

2016-10-25 Thread Josh Gao
On Fri, Oct 21, 2016 at 9:22 AM, Rob Landley wrote: > > The problem is without that chmod -R goes nuts. > Whoops, sorry. I probably shouldn't send out patches written immediately before leaving work :-) On Sat, Oct 22, 2016 at 1:43 PM, Rob Landley wrote: >

Re: [Toybox] [PATCH] Make chmod work on . and ..

2016-10-20 Thread Josh Gao
Trivial patch actually attached... On Thu, Oct 20, 2016 at 8:15 PM, Josh Gao <jm...@google.com> wrote: > Trivial patch attached. > From 232617a915f54e0d8d7fc2ce13e2d75e6ecd958d Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Thu, 20 Oct 2016 20:10:18 -0700 Sub

Re: [Toybox] fun with vfork

2016-10-13 Thread Josh Gao
On Wed, Oct 12, 2016 at 5:49 PM, Rob Landley wrote: > > So... no? I think? Is there a way _I_ can tag this? (I can't do my own > vfork prototype because I can't #undef the one I get out of unistd.h and > that's a fairly generic header. It's sad I can't redo function > prototypes

Re: [Toybox] fun with vfork

2016-10-11 Thread Josh Gao
Do you have vfork tagged with __attribute__((returns_twice))? AFAIK, that's the incantation to get gcc to do the right thing for setjmpy functions. On Oct 11, 2016 4:23 AM, "Rob Landley" wrote: > While doing the rest of nommu support in netcat -L, I had some variant of: > >

Re: [Toybox] Kernighan's awk repo

2016-07-22 Thread Josh Gao
On Jul 22, 2016 12:46 AM, "Rob Landley" wrote: > > 's not a bug if you never use the result. Not unless you enable > something that traps on an integer overflow or similar. FWIW, the standard explicitly says it's undefined behavior, and clang and gcc seem to be in a competition

[Toybox] [PATCH] Fix "tail -f single_file".

2016-03-19 Thread Josh Gao
TT.file_no was being incorrectly calculated as 0 when tail -f was passed a single argument, so tail -f with one argument wouldn't actually do the '-f' part. Patch attached. From 3feb4ae50b5135e7c9c8870968f87e318c615ba2 Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Wed,

[Toybox] [PATCH] Fix segfault in `find . -iname`

2016-02-04 Thread Josh Gao
Two patches attached (are github pull requests more convenient for you?) From ef19fb43d16432cfce54ee7fe940f3fa0a87ae8a Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Thu, 4 Feb 2016 10:43:20 -0800 Subject: [PATCH 1/2] Fix null dereference prior to check. --- toys/posix/

[Toybox] [PATCH] Implement tail -f.

2015-12-05 Thread Josh Gao
Patch attached because I don't trust gmail to not mangle it. From 394e1330bbeba6aed1f7897ea981610d5a925187 Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Fri, 4 Dec 2015 13:30:02 -0800 Subject: [PATCH] Implement tail -f. --- toys/posix/tail.

[Toybox] [PATCH] tail: use off_t instead of ssize_t for file offset.

2015-12-05 Thread Josh Gao
From 40fcc693c339ab9cafba7cf6f68cdb8b430401cf Mon Sep 17 00:00:00 2001 From: Josh Gao <jm...@google.com> Date: Fri, 4 Dec 2015 15:12:15 -0800 Subject: [PATCH] tail: use off_t instead of ssize_t for file offset. --- toys/posix/tail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)