summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace fixes.pjd2005-03-202-7/+6
|
* - Introduce an '-o' option which allows to match oldest of the matchingpjd2005-03-202-14/+33
| | | | | | | | | | processes. This option can be also found in Solaris and Linux. - Use timercmp(9) macro for timeval comparsion. - Include time.h directly, don't depend on stat.h doing it for us. Reviewed by: gad (first point) MFC after: 3 days
* - Introduce '-S' option which allows to match system processes (pgrep only).pjd2005-03-202-21/+21
| | | | | | | | | | | | | - Rename IS_KERNPROC() macro to PSKIP() and extend its functionality. Now it'll skip calling process and system processes when -S is not given. As a side effect it fixes '-n' option. Before it was always matching calling process (because of missing 'if (kp->ki_pid == mypid)' check) and after that, calling process was ignored. - When '-l' option is given and there are no arguments, use p_comm as an arguments list (this is helpful for kernel threads matching). Reviewed by: gad MFC after: 3 days
* Sort options properly.pjd2005-03-201-4/+4
| | | | | Reviewed by: gad MFC after: 3 days
* Add a -i option to ignore case in the process match.pjd2005-03-202-6/+12
| | | | | | Obtained from: NetBSD Reviewed by: gad MFC after: 3 days
* Add and document '-F' option which allows to use file where PID is storedpjd2005-03-202-4/+53
| | | | | | | for matching. Reviewed by: gad MFC after: 3 days
* Add and document '-j' option which allows to match processes based on itspjd2005-03-202-4/+30
| | | | | | | jail ID. Reviewed by: gad MFC after: 3 days
* Cleanup handling of colons in variable substitutions.harti2005-03-181-50/+41
| | | | | | Patch: 7.126 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Unfold parsing of single letter modifiers from multi-letter ones.harti2005-03-181-196/+258
| | | | | | Patch: 7.125 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Style: fix indentation and <space><tab>.harti2005-03-181-584/+596
| | | | | | Patch: 7.124 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Split out the 'S' modifier into its own function.harti2005-03-181-80/+83
| | | | | | Patch: 7.122,7.123 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Convert Var_Parse to a wrapper function.harti2005-03-181-60/+82
| | | | | | | | | Reduce the number of arguments passed between these functions by creating a special-purpose struct. Patch: 7.120,7.121 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Replace Lst_Find calls with LST_FOREACH loops. This helps inharti2005-03-182-48/+15
| | | | | constification und simplifies the code because the one-liner predicates can be inlined into the code.
* Replace a bogus use of Lst_Find with explicite LST_FOREACH callsharti2005-03-181-8/+14
| | | | and remove the unneeded second argument to ReadMakefile.
* Fix a bug in matching suffixes. Under certain circumstances the codeharti2005-03-181-44/+25
| | | | | | | | | | | | would access memory before the beginning of the string to match (the suffix match starts at the end of both the string and the suffix and proceedes to the begin until either the start of the suffix is hit or the character does not match). This could lead to a memcpy copying into random memory. Fix this by checking the length of the string to match too and replacing the Lst_Find calls with LST_FOREACH loops (last part by me). Submitted by: Matt Dillon <dillon@apollo.backplane.com> (in principle)
* Now that there are no users of Lst_ForEach and Lst_ForEachFrom are leftharti2005-03-162-89/+3
| | | | delete these two macros and all the associated stuff.
* Replace Lst_ForEach by LST_FOREACH.harti2005-03-162-43/+12
|
* Replace another bunch of Lst_ForEachs by LST_FOREACHs and simplify code.harti2005-03-161-145/+99
|
* Dike out another kvm indiscretion.phk2005-03-161-0/+2
|
* Fix a comment.harti2005-03-161-3/+1
|
* Get rid of another bunch of Lst_ForEach in favour of LST_FOREACH andharti2005-03-161-204/+109
| | | | simplify code accordingly.
* Ups. Revert the last commits. These have been committed by accident.harti2005-03-154-462/+431
|
* modifier_M: instead of going through the string twice to compute theharti2005-03-155-452/+472
| | | | | | | | size of the buffer we need, just allocate the possible maximum. Patch: 7.117 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Style: Move a variable from a local scope up to the begin of the function.harti2005-03-151-41/+38
| | | | | | | | | Rename result variable so common code becomes more visible. Rename freePtr to freeResult to make clear what pointer must be freed. Patch: 7.116, 7.116a Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Dike out unwarranted si_udev fondling.phk2005-03-151-1/+2
|
* Get rid of a number of Lst_ForEach calls in favour of LST_FOREACHharti2005-03-151-69/+26
| | | | and simplify the printing functions.
* VarParseLong: move the detection of the modifier separator ':' intoharti2005-03-151-19/+23
| | | | | | | | | the loop. Add a comment why the 'consumed' variable is updated. Rename lengthPtr to consumed. Patch: 7.115 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Yet another version of passing the last line to ParseFinishLine().harti2005-03-151-2/+2
| | | | | | | It turns out that some ports use the obscure feature of spreading a dependency block across multiple include files. While this seems bad style, allow it for now and call said function only at end of all input to process the really last line of everything.
* Get rid of another Lst_ForEach in favour of LST_FOREACH. Get ridharti2005-03-141-70/+38
| | | | of the now unused struct LstSrc and collapes two functions into one.
* ParseModifier(): rename rw_str to value and reindent cleanup section.harti2005-03-141-70/+72
| | | | | | | | | | ParseRestModifier() and ParseRestEnd(): move advancement of ptr to remove a confusing calculation. VarParseLong(): cleanup calculation of consumed. Patch: 7.114 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the creation of a Src structure into its own function.harti2005-03-141-43/+33
|
* Split off two function from VarParseLong to handle modifiers and theharti2005-03-141-172/+221
| | | | | | | | | actual variable lookup. Consistently rename lengthPtr to consumed. Update a number of comments to match the code. Patch: 7.111-113 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Convert a couple of other uses of Lst_ForEach to LST_FOREACH andharti2005-03-141-48/+40
| | | | simplify code.
* A handful of minor portability and style improvements.kientzle2005-03-143-15/+16
|
* Style correction: one tab after #define.kientzle2005-03-141-46/+47
|
* Re-unbreak the distfile target.kientzle2005-03-131-3/+4
| | | | | | | Also, reduce the WARNS level to 5 since different build environments end up using different Yacc skeletons. The BSD one does not predeclare yyparse, the FSF one does, so it's not really possible to consistently enforce both -Wmissing-prototypes and -Wredundant-decls.
* Fix a compile warning, fix the build.kientzle2005-03-131-1/+1
|
* "make depend" with .y files is trickier than it looks. <sigh>kientzle2005-03-131-3/+2
|
* Brain-o. Missing quote.kientzle2005-03-131-1/+1
|
* Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-thankientzle2005-03-139-39/+1067
| | | | | | | switches to support selecting files by time of modification. Special thanks to: Steven M. Bellovin, Rich $alz, and Jim Berets, authors of the public-domain getdate.y date-parsing code.
* Remove an unused #define. md5's with and without this commit match.ceri2005-03-131-1/+0
| | | | Approved by: murray (mentor)
* Add --strip-components option, per bin/77666.kientzle2005-03-135-2/+72
| | | | Thanks to: Sangwoo Shim
* Use socklen_t where appropriate.stefanf2005-03-111-1/+2
|
* Simplify the print routines by using LST_FOREACH instead of Lst_ForEachharti2005-03-113-64/+66
| | | | | | and inlining the small printing utility functions. Create a function that can be used to produce printable representations of flag words.
* Remove leading underscores from the pathname defines. All identifiersharti2005-03-113-25/+29
| | | | | with leading underscore followed by an uppercase letter are in the implementation namespace.
* Remove the leading underscore from structure tags. All identifiersharti2005-03-112-5/+5
| | | | with a leading underscore are in the implementation namespace.
* Style: Fix indentation.harti2005-03-111-1117/+1129
|
* Call ParseFinishLine() also for the last line in a file. Thisharti2005-03-111-0/+3
| | | | | | | | | | | | | | patch differs from the previous one in that it calls the function only when a real file hits EOF. The bodies of .for loops are also handled as files, but for these we don't want to end a dependency block on the 'EOF' as in: foo: do-this .for ... do-something .endfor do-more
* Back out the last commit. It turns out that this breaks more thanharti2005-03-111-3/+0
| | | | it fixes. This should fix the buildworld breakage.
* Constify Var_Dump and simplify it by inlining VarPrintVar.harti2005-03-102-15/+9
|
OpenPOWER on IntegriCloud