cvs commit: src/usr.sbin/watch watch.c

Christian S.J. Peron csjp at FreeBSD.org
Mon Aug 9 18:49:47 PDT 2004


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


More information about the cvs-all mailing list