Age | Commit message (Collapse) | Author |
|
Recent-ish clang doesn't like self-assignment. Google/Android code always
uses the [template-based moral equivalent of] __attribute__((__unused__))
to keep both compilers happy.
|
|
I never use these, so I didn't notice I'd broken them until someone who
does bringup complained.
The "one weird trick" with SEEK_DATA is documented at the URL we already
point to. SEEK_DATA was added in Linux 3.1 (2011) and isn't available in
glibc 2.19 (2014), so I've added that to "portability.h" for the benefit
of Ubuntu 14.04.
Also make -c and -C mutually exclusive.
Also fix some of the formatting I introduced earlier. (A clang-format file
would help prevent these mistakes...)
|
|
|
|
Once upon a time you could call fchown() and let it fail. Then gcc decided
not using its return code was inconcievable, but you could typecast it to (void)
to shut it up. Then gcc noticed people doing that and clutched its pearls and
took it away, so I added an if() statement that does nothing with the result
because we _expect_ this to fail when we're not root. Then clang started
complaining about an if (); statement with the semicolon on the same line,
but decided it's ok if the ; is on the next line (I.E. significant whitespace
in C), so I'm adding an "assignemnt to self" that gets optimized away so
it does a more _explicit_ nothing (the same way you suppress gcc's broken
"this isn't used uninitialized" warnings).
If the compilers weren't going to so much trouble to force the issue I might
add code to only call fchown when we're UID 0, but I refuse to be coerced
into it. (And if getpid() is still a system call instead of a vdso member
then it doesn't actually _save_ us anything, the dentry should be hot and
the permission check was just "if (!uid)" before selinux entered into it and
we're operating on an fd so the security's the same.)
|
|
an array index, which doesn't work as a local variable name. So rename it.
|
|
__attribute__((returns_twice)) instead of noinline.
Yes LLVM supports it: https://llvm.org/bugs/show_bug.cgi?id=6287
|
|
comment (I.E. negative first value _left_ justifies). This makes ps display
the same truncated values with and without a tty.
Also add a few comments to the rest of the file.
|
|
make xsocket()'s returned fd CLOEXEC.
|
|
shouldn't segfault falling off the end of the list trying to report a
nonexistent error condition.
|
|
|
|
line aren't filtered out. Audited all the callers and removed redundant
calls, adjusted call sequence, etc. (And let rm _not_ do this, because posix.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instead of a struct. This means it can return "12345" even if that user/group
doesn't exist in /etc/passwd and similar.
All the users were immediately dereferencing it to get pw_uid or gr_gid
anyway, so just return it directly and adjust the users. This fixes
things like "chown 12345:23456 filename".
|
|
apply it to "true" and "false".
|
|
of number, but never NULL. Both returned in static buffer good through
next call.)
|
|
add xopenro() that takes one argument and understands "-" means stdin,
and switch over lots of users.
|
|
Recent Linux uapi <linux/xattr.h> headers define XATTR_NAME_SMACK.
The <sys/xattr.h> include at the top of lib/lsm.h means that even
though the direct include of <linux/xattr.h> is guarded, it may
have already happened transitively anyway.
(The alternative fixes would be to hard-code the correct value for
XATTR_NAME_SMACK here instead, or #undef XATTR_NAME_SMACK.)
|
|
|
|
|
|
|
|
to use this (and tail) as examples of simplicity of implementation winning
and losing.
|
|
Support hex (requested by users).
Support status=noxfer and status=none (requested by users).
Fix status output.
Clarify large numbers in --help output.
Use O_TRUNC rather than ftruncate unless we're also seeking.
New tests.
Also partial cleanup (reuse of existing code, removal of non-GLOBALS globals,
and merge dd_main and do_dd).
|
|
in [groups].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
More's sigatexit handler needs to distinguish between normal exit and exit
due to receipt of a signal.
Change tty_sigreset to look at the signal number too, so that pressing 'q'
to exit top doesn't cause its exit status to be 128.
|
|
|
|
The ps.c change allows us to start. The interestingtimes.c change allows
us to clean up properly afterwards if you ^C out (which you usually do).
Tested with both ssh and "adb shell" (the latter being where I noticed
the problem).
|
|
|
|
both did it) so use getbasename instead.
|
|
external/toybox/lib/linestack.c:84:5: error: conflicting types for 'crunch_str'
int crunch_str(char **str, int width, FILE *out, char *escmore,
^
external/toybox/lib/lib.h:228:5: note: previous declaration is here
int crunch_str(char **str, int width, FILE *out, char *escmore,
^
I'm not sure whether the interface was intended to be wchar_t or int, but
switching to int is the smaller change...
|
|
(The sigatexit() handler list code now calls the handlers on the normal
exit path, so _exit(1) from the handler is wrong; exit_signal() modifies
toys.exitval if necessary.)
|
|
|
|
|
|
header unconditionally. (This fixes the warning when CP_PRESERVE disabled.)
|
|
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics,
remove dirtree_start() and don't export dirtree_handle_callback(), instead
offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread
passing 0 for flags.)
|
|
major/minor/makedev, but glibc has vowed to break existing programs
(https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html)
and replace it with _another_ non-standard header (not in posix or lsb),
so let's just add functions to lib/ that do the transform ourselves.
|