Commit Graph

64 Commits

Author SHA1 Message Date
ru
9a0f1e9891 Sort sections. 2005-01-18 20:02:45 +00:00
csjp
3e592b9646 By default, the watch utility will attempt to open /dev/snp0, if
another process already has /dev/snp0 open, the snp(4) will return
EBUSY, in which case watch will try to open /dev/snp1..9. Currently
watch does not check errno to see if the failure was a result of EBUSY.

This results in watch making futile attempts to open snp0..snp9 even
though devices may not exist or the caller does not have permissions
to access the device.

In addition to this, it attempts to setup the screen for snooping even
though it may not ever get an snp device.

So this patch does two things
1) Checks errno for EBUSY, if open(2) fails for another reason
   print that reason and exit.
2) setup the terminal for snooping after the snp descriptor has
   been obtained.

Approved by:	bmilekic (mentor)
2004-08-10 01:49:46 +00:00
ru
560e5d06b5 Eliminated double whitespace. 2004-07-03 18:35:53 +00:00
ru
485e003d41 Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +00:00
csjp
a15016ab1c Remove constant which makes the assumption that the length of
_PATH_DEV will never change. In the un-likely event that _PATH_DEV
should ever change, watch(8) would have broke because of a
mis-generated device name.

Approved by:	bmilekic (mentor)
Pointed out by:	Yvan Boily
2004-05-29 21:03:00 +00:00
grehan
17b9201288 Userland signed char fixes for PPC build. Problems were using a char
return for getopt() and comparing to -1, ditto with fgetc() and EOF,
and using the kg_nice value from <sys/user.h>

Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
Reviewed by: obrien, bde (a while back)
Tested lightly on: ppc, i386, make universe
2004-01-22 07:23:36 +00:00
obrien
7797e9f77e Use __FBSDID over rcsid[]. Protect copyright[] where needed. 2003-05-03 21:06:42 +00:00
obrien
6709fe0c57 style.Makefile(5) 2003-04-04 17:49:21 +00:00
schweikh
28d78933e7 Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
tmm
4f6538e58f The FIONREAD sysctl operates on an int *, not a size_t *.
Reviewed by:	dd
2002-11-11 10:56:57 +00:00
mikeh
7de17fd71a Add break's to case blocks.
PR:		bin/41511
Submitted by:	Daniel Hagan <dhagan@acm.vt.edu>
2002-08-10 08:42:10 +00:00
charnier
90baea60d8 The .Nm utility 2002-07-14 14:47:15 +00:00
imp
940f0722a9 de __P
ANSI functions
minor knf
2002-06-12 04:28:15 +00:00
bde
735b820e9d #include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.
2002-02-25 05:31:49 +00:00
dd
7c8c8d0905 Talk about what the user needs to do to get the snp devices, and how
watch(8) will try to help them by loading the module.

PR:		25420
2001-11-24 17:02:58 +00:00
dd
42928b15fa Change 'superuser' to 'user' which was forgotten in the previous
delta.  Remove fake SCCS id while I'm here.
2001-11-24 16:56:43 +00:00
dd
ef9023eade Remove the sentence about only root being able to run watch(8). It
was never technically true (it's snp(4) that required root, not
watch(8)), and after snp.c 1.64, isn't even effectively true, since
who can run watch(8) depends on the permissions of the snp device(s).

Sort options in SYNOPSIS and DESCRIPTION while I'm here.
2001-11-24 15:51:34 +00:00
dd
7f3ae86b3c Add an -f option which allows one to specify a snp device to use.
Previously, watch would always use the first device it could
successfully open, but this isn't always desired.  Specifically, it
may not be desired during debugging (of snp), or if a particular snp
device has different permissions (which makes since after snp.c 1.64).
2001-11-24 15:41:38 +00:00
rwatson
2fa4234089 o When "-n" is used with watch, it disables the use of <control-X> to
change terminals being watched.  This change makes watch pass the
  <control-X> through to the terminal if it's not being intercepted--
  previously, the keypress would simply be dropped.
2001-11-07 19:15:19 +00:00
dd
1952750c0b Automatically load the "snp" module if it isn't already present. 2001-09-09 14:57:48 +00:00
ache
d07e95dcc1 Back out WARNS commenting - local fault 2001-07-23 12:38:00 +00:00
ache
d2b9e248dd Unbreak world - comment out WARNS=2 - deadly warning on tgetstr 2001-07-23 10:46:01 +00:00
obrien
4b92fa588b Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
dd
5dc561a10a Add prototypes, staticize, constify, don't shadow global variables and
functions, remove an unused function, and silence other assorted
warnings.

Set WARNS=2.
2001-07-15 11:03:28 +00:00
olgeni
4db5ab098d Replace an instance of the "watch" word with the ".Nm" macro: it is used to
specify the command name.
2001-05-04 23:27:30 +00:00
ru
b15a893144 - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:42:20 +00:00
rwatson
b8bc5d059a o Strip BINMODE from Makefile. Installing watch with 0500 provides no
added security benefit, as it doesn't provide extra privilege.
  Protection against inappropriate snooping is done by protecting
  /dev/snp* properly.
2001-03-22 04:10:51 +00:00
ru
42350947e7 Set the default manual section for usr.sbin/ to 8. 2001-03-20 18:17:26 +00:00
obrien
46d04a9db4 Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
ru
c3189e713e mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
charnier
d88054857f Add missing .El.
-Wall cleaning.
2000-01-23 20:27:32 +00:00
phantom
b85877548f ``tty'' is not required parameter 1999-10-30 14:52:24 +00:00
peter
27eff20bc0 Fix warning: return type of main' is not int' 1999-09-15 01:58:44 +00:00
peter
b6784c4210 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
nik
7effc709bc Add $Id$, to make it simpler for members of the translation teams to
track.

The Id line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:12:29 +00:00
charnier
c94dce23b1 .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq. 1998-03-23 08:31:20 +00:00
charnier
510da8d3e5 Use err(3). 1997-10-27 12:21:10 +00:00
imp
15c4d207bc compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-31 05:11:47 +00:00
bde
b2f7dfd03d Removed old bogus prerequisite <sys/select.h>. Cleaned up #include mess. 1997-03-19 04:44:07 +00:00
roberto
fd5ca16eb8 1. change tty handling from sgttyb to termios,
2. fix a potential buffer oflow,
3. makes watch(8) conform to sysexits(3).

Not a strong 2.2 candidate even if it would be nice.

Reviewed by:	joerg, imp
1997-03-13 08:35:45 +00:00
peter
32d6b795de Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
wosch
00e37028d0 Sort cross references. 1997-01-20 00:03:00 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
jkh
4526dad8be Remove breakage of 1.8.2.2, choose slightly better character for quit. 1996-12-30 09:01:50 +00:00
jkh
beca9e8573 Use RAW, not CBREAK 1996-12-17 15:26:40 +00:00
fenner
fc6e0bc742 Fix a typo in the man page (the "-n" flag was added to the synopsis in
a comment).
1996-12-02 16:21:20 +00:00
jkh
3b6d602861 I have added a '-n' flag to the watch(8) command. This option
disables the ability to interactively select a new tty.  I have also
removed a check for uid == 0 because it gets in the way of using suid
mode based access control.  Watch (8)is only runnable by root, so this
does not really change things much.

Closes PR#2131

Submitted-By: adrian@virginia.edu
1996-12-02 12:32:46 +00:00
peter
f56698a460 Set ${DPADD}, use +=, add $Id$ 1996-09-02 23:38:58 +00:00
mpp
0da347e402 Use the .Fx macro where appropriate. 1996-08-23 00:57:08 +00:00
jkh
8b5d603a61 Properly save and restore the terminal characters! 1996-03-01 18:21:41 +00:00