summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-13120-17/+191
| | | | needed.
* Don't read the newline character to line buffer because lines are passedjh2009-12-121-16/+13
| | | | | | | | | | | | | | | to wcscoll(3). Newline characters could cause incorrect results when comparing lines. Also, if an input line didn't contain a newline character, it was omitted from the output. According to my interpretation, SUSv3 requires that the newline is always printed. Add regression tests for the cases. [1] PR: bin/140976 Submitted by: D'Arcy Cain (original version) [1] Approved by: trasz (mentor)
* The input line length limit mentioned on the manual page was removed byjh2009-12-121-5/+1
| | | | | | r179374. Approved by: trasz (mentor)
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-11121-193/+19
| | | | Tested with: make universe
* Remove unnecessary termcap.h includes inherited from extern.h and otherdelphij2009-12-117-27/+16
| | | | | unneeded headers. While I'm there, make function definations ANSI prototypes.
* Move unistd.h includes to individual .c files and remove unnecessarydelphij2009-12-119-2/+7
| | | | includes.
* Remove unnecessary includes.delphij2009-12-1110-20/+0
| | | | Reviewed by: rodrigc
* Add my birthday.gavin2009-12-091-0/+1
| | | | Approved by: ed (mentor)
* Let w(1) use utmpx.ed2009-12-062-31/+28
| | | | | | | | | | We don't have UT_*SIZE anymore. One of the reasons for that is because all strings are null terminated, there is no need for apps to copy strings out of the utmpx structure. This means we can define W_DISP*SIZE lengths for all columns. While there, adjust the sizes a little. Steal some bytes from the username column, while extending the hostname column quite a bit.
* Let systat's vmstat use utmpx.ed2009-12-052-16/+9
|
* Port who(1) to utmpx.ed2009-12-052-58/+56
| | | | | | | | | | (Un)fortunately there is no standardized interface to switch between utmp database files, so we must call ulog_setutxfile() here. I'm also changing the column widths to magic numbers here. Display layout should in this case not be derived from structure fields sizes. Because I don't want struct utmpx ever to become too small, the fields are too big to reserve all the space.
* Let wall(1) use utmpx.ed2009-12-052-28/+29
| | | | | | | | Because our implementation guarantees the strings inside struct utmpx to be null terminated, we don't need to copy everything out, which makes the code nicer to read. Also set WARNS to 6 and add $FreeBSD$ to keep SVN happy.
* Let wall(1) use utmpx.ed2009-12-052-18/+17
| | | | | | | | Because our implementation guarantees the strings inside struct utmpx to be null terminated, we don't need to copy everything out, which makes the code nicer to read. Also set WARNS to 6 and add $FreeBSD$ to keep SVN silent.
* Add WARNS?=6, because it seems to build out of the box.ed2009-12-051-0/+2
|
* Use _ULOG_POSIX_NAMES here, to make eventual porting to <utmpx.h> easier.ed2009-12-051-4/+5
| | | | | By the time we gain a real <utmpx.h>, it's just a matter of changing the include at the top and -lulog from the Makefile.
* Add a missing space to the error message when execvp() failed.stefanf2009-12-051-1/+1
|
* Connect unzip to the build.rdivacky2009-12-031-0/+1
| | | | | | Approved by: ed (mentor) Approved by: des (unzip author) Tested by: exp ports build (miwi)
* Use USER_PROCESS instead of LOGIN_PROCESS.ed2009-12-031-1/+1
| | | | | | POSIX isn't clear about how the fields should be used, but according to utmpx(5) on Linux, LOGIN_PROCESS refers to a TTY that's still running a getty.
* Port users(1) to libulog.ed2009-12-032-22/+27
| | | | | | Instead of digging through the utmp database by hand, use proper API calls to do so. Instead of parsing entries with a non-empty ut_user, we now look at LOGIN_PROCESS entries.
* Remove -t from the manpage and usage.jhb2009-12-012-6/+3
|
* Unbreak user space after if_timer/if_watchdog removal in r199975.bz2009-12-013-11/+0
| | | | Tested by: glebius
* Add more statistics variables for IPcomp.bz2009-11-291-0/+10
| | | | | | | Try to version the struct in a backward compatible way. People asked for the versioning of the stats structs in general before. MFC after: 5 days
* - correctly render the provided exampledanger2009-11-281-1/+1
| | | | | PR: docs/140962 Submitted by: mharo
* unifdef: fix invalid array access when nesting limit exceededfanf2009-11-271-4/+8
| | | | | | | | | | | | If the number of nested #if blocks exceeds 64, nest() increments the nesting depth and then reports an error. The message includes the line number for the start of the current #if block, which is read from past the end of the relevant array. Avoid the out-of-bounds read by reporting the error and exiting before the nesting depth has a chance to increase. Submitted by: Jonathan Nieder <jrnieder@gmail.com>
* unifdefall: optimise the loop that builds the unifdef command.fanf2009-11-261-9/+17
| | | | | | | | | | | | | | The old code used a shell loop to convert each controlling macro definition into a command-line argument, reading the macro definitions file each time. The new code converts the list of controlling macros into a sed script which can run through the list of macro definitions in one go. Add some explanatory comments, since the code is quite meta. Use {} instead of () for redirecting a group of commands. Submitted by: Jonathan Nieder <jrnieder@gmail.com>
* Remove debugging remnants from unifdefall.fanf2009-11-261-2/+2
| | | | Submitted by: Jonathan Nieder <jrnieder@gmail.com>
* Update unifdef to my upstream version 1.188fanf2009-11-253-134/+300
| | | | | | | | | | | | | | | | | | | | | Main highlights: (A) The new -B option compresses blank lines around a deleted section so that blank lines around "paragraphs" of code don't get doubled. (B) Lenient evaluation of && and || so that #if expressions can be evaluated even when some of their sub-expressions cannot be. (C) The evaluator can now handle macros with arguments. (D) Portability fixes, especially for unifdefall. Contributions from: Ben Hutchings at Solarflare Communications (A and B) Anders H Kaseorg <andersk@mit.edu> (A and C) Jonathan Nieder <jrnieder@gmail.com> (D) Obtained from: http://dotat.at/prog/unifdef/
* Change gcore in order to get rid of the procfs accesses and use FreeBSD'sattilio2009-11-254-198/+185
| | | | | | | | | | | | | | | | | | | | | specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process Side note: <janitor task> the interface can be further lifted in order to get rid of the very last procfs interfaces remnants and made more suitable for copying with sysctl/ptrace interface </janitor task>. Obtained from: Sandvine Incorporated Reviewed by: emaste, rwatson Sponsored by: Sandvine Incorporated MFC: 1 month
* Add the possibility to show informations about dropped packets on theattilio2009-11-251-4/+13
| | | | | | | | | input path when showing informations about the interfaces. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 2 weeks
* When -n is specified, attempt to turn hostnames found in utmp into IPume2009-11-221-11/+31
| | | | | | | | addresses, again. However, change a hostname into an IP address, only when a host has just one A/AAAA RR. Requested by: candy__at__kgc.co.jp MFC after: 2 weeks
* The output of perror(1) is now showing local messages for localesedwin2009-11-221-0/+2
| | | | | | | supported by libc/nls PR: bin/140499 Approved by: gnn@
* Catch up with r144020's /Dir_FindFile/Path_FindFile/obrien2009-11-172-2/+2
|
* Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'obrien2009-11-172-27/+0
| | | | to be unable to find a match in Path_FindFile().
* We should distinguish between a real truncated case and EOF afterdelphij2009-11-161-3/+14
| | | | | | | | | | | BZ_STREAM_END triggered re-init. Do it by introducing a new flag to represent the 'cold' case after bzip2 state is reinitialized. This fixes regression reported on -current@ as well as another one I found during twiddling with gzip. Reported by: swell.k gmail.com MFC after: 1 week
* Update malloc utrace structure parsing to reflect the change (r199265)cperciva2009-11-141-11/+8
| | | | | | | | in how malloc_init is logged from (0, 0, 0) to (-1, 0, 0). While we're here, simplify the logic. Reviewed by: jhb (earlier version)
* Use ncursesw to output the date field of vmstat displayume2009-11-132-2/+2
| | | | with multi-byte string, correctly.
* Although the file has "ex:ts=4", do some " " -> \t translationsedwin2009-11-121-23/+23
| | | | so that it is also nicely readable with ts=8.
* Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 filesdelphij2009-11-091-5/+14
| | | | | | | as created by pbzip2. Submitted by: mrg (NetBSD.org) MFC after: 1 week
* Use a safety belt for cases where corrupted narg can be passed to theattilio2009-11-071-1/+1
| | | | | | | | | | | ktrsyscall(). print_number() does decrement the number of arguments, leading to infinite loops for negative values. Reported by: Patrick Lamaiziere <patpr at davenulle dot org>, Jonathan Pascal <jkpyvxmzsa at mailinator dot com> Submitted by: jh PR: bin/120055, kern/119564 MFC: 1 week
* Static'ify signal handler which is not called from outside.delphij2009-11-031-1/+1
|
* Use our canonical .Dd format.brueffer2009-11-021-1/+1
| | | | Submitted by: Ulrich Spoerlein
* When reading input from a file or device (via -f option) set themckusick2009-10-301-0/+1
| | | | | | input to be in non-buffering mode so that input lines are logged as they occur rather than being saved up until a buffer's worth of input has been logged.
* Add notes pointing out that bsdiff does not store file hashes andcperciva2009-10-302-0/+40
| | | | | | | | | bspatch thus does not verify file hashes, and that consequently it is recommended that users store hashes separately and verify files before and after running bspatch. Requested by: BugMagnet MFC after: 1 week
* When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU countsjhb2009-10-291-0/+81
| | | | | | | | and sum them to form the total counts. PR: bin/135893 Submitted by: Mikolaj Golub to my trociny of gmail MFC after: 1 week
* Reset UPTODATE gnodes after remaking makefiles when makefjoe2009-10-181-15/+21
| | | | | is not going to be restarted: such nodes could be marked UPTODATE without doing rebuild due to remakingMakefiles being TRUE.
* Exit with non-zero error code in case of errorsfjoe2009-10-181-0/+2
| | | | when make is run with -k and not parallel (compat) make is run.
* - If lstat()/stat() fails with an error other than ENOENT, don't ignorejh2009-10-161-4/+11
| | | | | | | | | | | | | | | the error and assume that the file doesn't exist. Touch could return success with -c option even if the file existed and time was not set. - If the first utimes_f() call fails with -A option, give up and don't continue trying to set times to current time. [1] - Set exit status to 1 when setting of timestamps fails for a directory or symbolic link even though lstat()/stat() would succeed. - Don't print bogus error message when rw() succeeds. PR: bin/112213 Submitted by: jilles [1] Reviewed by: jilles Approved by: trasz (mentor)
* Print routing statistics as unsigned short rather than unsigned int,rwatson2009-10-151-5/+5
| | | | | | | | otherwise sign extension leads to unlikely values when in the negative range of the signed short structure fields that hold the statistics. The type used to hold routing statistics is arguably also incorrect. MFC after: 3 days
* - Catch SIGHUP to perform cleanup before exiting.jh2009-10-112-4/+8
| | | | | | | | | | | | | | | | - Exit if getch() returns with an error other than EINTR. Otherwise systat(1) may get stuck in an infinite loop if it doesn't receive SIGHUP when terminal closes. [1] - Remove attempt to clear stdio error indicators. getch() doesn't use stdio, making it useless. [2] - Remove unneeded masking of getch() return value. [2] PR: bin/107171 Reviewed by: bde Approved by: trasz (mentor) Obtained from: OpenBSD [1] Suggested by: bde [2] MFC after: 1 month
* Add the comment "(FreeBSD only)" to the altmonth_x keywordsedwin2009-10-071-12/+12
| | | | MFC after: 1 week
OpenPOWER on IntegriCloud