summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* Update chio(1) and ch(4) to support reporting element designators.ken2013-04-191-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows mapping a tape drive in a changer (as reported by 'chio status') to a sa(4) driver instance by comparing the serial numbers. The designators can be ASCII (which is printed out directly), binary (which is printed in hex format) or UTF-8, which is printed in either native UTF-8 format if the terminal can support it, or in %XX notation for non-ASCII characters. Thanks to Hiroki Sato <hrs@> for the explaining UTF-8 printing and example UTF-8 printing code. chio.h: Modify the changer_element_status structure to add new fields and definitions from the SMC3r16 spec. Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and define a new CHIOGSTATUS ioctl. Clean up some tab/space issues. chio.c: For the 'status' subcommand, print the designator field if it is supplied by a device. scsi_ch.h: Add new flags for DVCID and CURDATA to the READ ELEMENT STATUS command structure. Add a read_element_status_device_id structure for the data fields in the new standard. Add new unions, dt_or_obsolete and voltage_devid, to hold and address data from either SCSI-2 or newer devices. scsi_ch.c: Implement support for fetching device IDs with READ ELEMENT STATUS data. Add new arguments to scsi_read_element_status() to allow the user to request the DVCID and CURDATA bits. This isn't compiled into libcam (it's only an internal kernel interface), so we don't need any special handling for the API change. If the user issues the new CHIOGSTATUS ioctl, copy all of the available element status data out. If he issues the OCHIOGSTATUS ioctl, we don't copy the new fields in the structure. Fix a bug in chopen() that would result in the peripheral never getting unheld if chgetparams() failed. Sponsored by: Spectra Logic Submitted by: Po-Li Soong MFC After: 1 week
* Add the Clang specific -Wmissing-variable-declarations to WARNS=6.ed2013-04-191-0/+2
| | | | | | | | | | | | | This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@
* sh: Don't modify exit status when break/continue/return passes !.jilles2013-04-121-0/+2
| | | | | | | | This matches what would happen if ! P were to be replaced with if P; then false; else true; fi. Example: f() { ! return 0; }; f
* sh: Add const to nodesavestr().jilles2013-04-071-3/+3
|
* IFP4 change 222074.brooks2013-04-031-0/+7
| | | | | | | | | | Introduce an explicit close of the output descriptor so that work done on close is accounted for in the summary output triggered at exit (implicit close()s occur after atexit() hooks). This is useful because some devices such as cfi(4) may perform signficant work after a close occurs (e.g. erasing and rewriting a block of flash).
* sh: Write as much into the heredoc pipe as possible, to avoid forking.jilles2013-04-021-5/+13
| | | | | | Use non-blocking I/O to write as much as the pipe will accept (often 64K, but it can be as little as 4K), avoiding the need for the ugly PIPESIZE constant. If PIPESIZE was set too high, a deadlock would occur.
* sh: Fix various compiler warnings.jilles2013-04-0111-32/+36
| | | | | | | It now passes WARNS=7 with clang on i386. GCC 4.2.1 does not understand setjmp() properly so will always trigger -Wuninitialized. I will not add the volatile keywords to suppress this.
* Mention that read_attributes, write_attributes, read_acl and write_acltrasz2013-04-011-1/+5
| | | | | | | are always permitted for the file owner. PR: kern/174948 MFC after: 1 week
* Minor mdoc fix.joel2013-03-291-1/+1
|
* sh(1): Mention possible ambiguities with $(( and ((.jilles2013-03-241-1/+14
| | | | | | | | | In some other shells, things like $((a);(b)) are command substitutions. Also, there are shells that have an extension ((ARITH)) that evaluates an arithmetic expression and returns status 1 if the result is zero, 0 otherwise. This extension may lead to ambiguity with two subshells starting in sequence.
* Fix compiling ed w/ WITHOUT_ED_CRYPTO... These variables aren'tjmg2013-03-231-3/+1
| | | | | | used.. Submitted by: deeptech71 at gmail dot com
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-212-6/+2
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* sh: Recognize "--" and explicitly reject options in wait builtin.jilles2013-03-151-3/+4
| | | | | | If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be.
* Add a few examples.joel2013-03-157-7/+102
| | | | Obtained from: OpenBSD
* sh: When executing a trap, keep exit status along with evalskip.jilles2013-03-031-2/+3
| | | | | | | This ensures 'return' in a trap returns the correct status to the caller. If evalskip is not set or if it is overridden by a previous evalskip, keep the old behaviour of restoring the exit status from before the trap.
* Enhance test(1) by adding provision to compare any combination of thepeterj2013-02-252-27/+215
| | | | | | | | | access, birth, change and modify times of two files, instead of only being able to compare modify times. The builtin test in sh(1) will automagically acquire the same expansion. Approved by: grog MFC after: 2 weeks
* sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.jilles2013-02-235-20/+23
|
* sh: Fix a crash with the stackmark code.jilles2013-02-191-0/+2
| | | | | | | | | | | | | | | | If a stack mark is set while the current stack block is empty, the stack block may move later on (because of realloc()) and the stack mark needs to be updated. This updating does not happen after popstackmark() has been called; therefore, call setstackmark() again if the stack mark is still being used. For some reason, this only affects a few users. I cannot reproduce it. The situation seems quite rare as well because an empty stack block would usually be freed (by popstackmark()) before execution reaches a setstackmark() call. PR: 175922 Tested by: KT Sin
* Fix NFSv4 permission description in setfacl(1) manual page: the 'D'trasz2013-02-081-2/+2
| | | | | | means delete_child, not delete. MFC after: 1 week
* Improve description of the "-m" option to setfacl(1).trasz2013-02-081-5/+6
| | | | | Submitted by: scottl MFC after: 1 week
* In the setfacl(1) manual page, make it clear that for NFSv4 ACLs,trasz2013-02-081-1/+6
| | | | | | one should really use -a and -x instead of -m. MFC after: 1 week
* sh: Simplify mksyntax and make it fit for cross-compiling.jilles2013-02-071-88/+66
| | | | | | | | | | | | | | | | | | | | Now it outputs fixed files, which use constants provided by the C standard library to determine appropriate values for the target machine. Before, mksyntax inspected the host machine which resulted in subtle breakage if e.g. char is signed on the host and unsigned on the target such as when cross-compiling on x86 for ARM. Tested using -funsigned-char on amd64. Compiling build-tools without it and sh itself with it causes various tests to fail without this change but not with this change. With consistent -funsigned-char, tests pass with or without this change. The mksyntax program could be removed and syntax.c and syntax.h committed to the repository. Submitted by: Christoph Mallon MFC after: 2 weeks
* sh: Fix a comment.jilles2013-02-071-1/+1
|
* Catch TRACE parameters up with r238888. This change is only needed whendelphij2013-02-071-1/+1
| | | | debugging is enabled.
* Document P_PPTRACE.kib2013-02-071-1/+2
| | | | MFC after: 2 weeks
* sh: Do not test for digit_contig in mksyntax.jilles2013-02-051-46/+2
| | | | | | | | | ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters 0123456789 are contiguous. The generated syntax.c and syntax.h remain the same. Submitted by: Christoph Mallon
* sh: Expand here documents in the current process.jilles2013-02-035-24/+48
| | | | | | | | | | | | | | | | | Expand here documents at the same point other redirections are expanded but use a non-fork subshell environment (like simple command substitutions) for compatibility. Substitition errors result in an empty here document like before. As a result, a fork is avoided for short (<4K) expanded here documents. Unexpanded here documents (with quoted end marker after <<) are not affected by this change. They already only forked when >4K. Side effects: * Order of expansion is slightly different. * Slow expansions are not executed in parallel with the redirected command. * A non-fork subshell environment is subtly different from a forked process.
* sh: Prefer our character classification functions to <ctype.h>.jilles2013-01-312-3/+2
|
* sh: Show negated commands (!) in jobs output.jilles2013-01-311-0/+4
|
* Fix date.joel2013-01-291-1/+1
|
* Add -l option to cat(1). This option causes cat(1) to use fcntl(2) tobrooks2013-01-292-6/+30
| | | | | | | | set an exclusive advisory lock on stdout. This will be used to guarantee orderly writing to METALOG. Sponsored by: DARPA, AFRL Obtained from: NetBSD (mason)
* Return with an error from copy_link(), copy_fifo() and copy_special() ifmarkj2013-01-271-0/+17
| | | | | | | | the -n option is specified and the destination file exists. PR: bin/174489 Approved by: rstone (co-mentor) MFC after: 2 weeks
* Don't time travel back and use a present date.delphij2013-01-251-1/+1
| | | | Noticed by: mckusick
* - Wrap long line;delphij2013-01-242-2/+4
| | | | | | - Add -, to SYNOPSIS section. MFC after: 2 weeks
* Return "failure" as we do for 'cp -i' and a "n" answer.obrien2013-01-231-1/+1
| | | | | | Otherwise with '-v' we print out the file name as if it was copied: /tmp/2gb-card/M0132.CTG not overwritten /mnt/DCIM/CANONMSC/M0132.CTG -> /tmp/2gb-card/M0132.CTG
* Add FILES section.joel2013-01-221-2/+14
| | | | Discussed with: jilles
* Change the $ENV example to use .shrc instead of .shinit. This is consistentjoel2013-01-201-3/+3
| | | | | | with what we use in /usr/share/skel/dot.profile. Discussed with: jilles
* sh: Move some stackmarks to fix high memory usage in some loops.jilles2013-01-201-11/+5
| | | | | | | | | | | | If a loop contained certain commands (such as redirected compound commands), the temporary memory for the redirection was not freed between iterations of the loop but only after the loop. Put a stackmark in evaltree(), freeing memory whenever a node has been evaluated. Some other stackmarks are then redundant; remove them. Example: while :; do { :; } </dev/null; done
* sh: Remove mkinit's initialization routine.jilles2013-01-205-35/+12
| | | | Instead, call the only init function left directly from main().
* sh: Replace an mkinit use with an initialization.jilles2013-01-191-10/+5
|
* - Move 'showthreads' check out of fmt.c.jhb2013-01-192-2/+2
| | | | | - Update shadow copy of fmt_argv() prototype in w.c and fix calls for additional parameter.
* Include the thread name along with the command name when displaying thejhb2013-01-183-10/+16
| | | | | | | | | command name of a thread from a multi-threaded process that doesn't have an available argument list (such as kernel processes) and threads display is enabled via -H. Reviewed by: alfred, delphij, eric@vangyzen.net MFC after: 1 week
* Remove useless variable 'Pflag':eadler2013-01-171-7/+5
| | | | | | | -P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables. Approved by: cperciva MFC after: 3 days
* Use a different way to silence clang analyzer as done in r245494 bydelphij2013-01-161-2/+1
| | | | | | explicitly telling the compiler that we are on the exit route. X-MFC: together with r245494
* Free memory before exiting in order to silence a warning from the clangeadler2013-01-161-0/+1
| | | | | | | static analyzer Approved by: cperciva MFC after: 3 days
* sh: Simplify cd-hash interaction.jilles2013-01-142-40/+15
| | | | | | | | Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a utility, cd clears the entire table. As a result, the '*' in hash no longer happens.
* sh: Pass $? to command substitution containing compound/multiple commands.jilles2013-01-141-2/+1
| | | | | Example: false; echo $(echo $?; :)
* sh: Fix crash when parsing '{ } &'.jilles2013-01-131-2/+2
| | | | MFC after: 1 week
* sh: Don't lose $? when backquoted command ends with semicolon or newline.jilles2013-01-131-1/+2
| | | | | | | | | An empty simple command was added and overwrote the exit status with 0. This affects `...` but not $(...). Example: v=`false;`; echo $?
* When WCHAR_MIN == 0 the check if a wchar_t value will always be true. Inandrew2013-01-061-1/+4
| | | | this case skip the test as gcc complains it is always true.
OpenPOWER on IntegriCloud