Date: Tue, 10 Aug 2004 01:49:46 +0000 (UTC) From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.sbin/watch watch.c Message-ID: <200408100149.i7A1nkDt089225@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
csjp 2004-08-10 01:49:46 UTC
FreeBSD src repository
Modified files:
usr.sbin/watch watch.c
Log:
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)
Revision Changes Path
1.31 +7 -3 src/usr.sbin/watch/watch.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408100149.i7A1nkDt089225>
