Don't allow CONS_HISTORY ioctl to alter history pointers

while in "scroll mode" (return EBUSY).
Suggested by:	Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
This commit is contained in:
brian 1997-07-09 14:10:19 +00:00
parent f4e6702e75
commit 7bafd4334c
3 changed files with 9 additions and 3 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.221 1997/07/07 13:42:42 brian Exp $
* $Id: syscons.c,v 1.222 1997/07/08 13:38:58 brian Exp $
*/
#include "sc.h"
@ -958,6 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
if (cur_console->status & BUFFER_SAVED)
return EBUSY;
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.221 1997/07/07 13:42:42 brian Exp $
* $Id: syscons.c,v 1.222 1997/07/08 13:38:58 brian Exp $
*/
#include "sc.h"
@ -958,6 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
if (cur_console->status & BUFFER_SAVED)
return EBUSY;
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.221 1997/07/07 13:42:42 brian Exp $
* $Id: syscons.c,v 1.222 1997/07/08 13:38:58 brian Exp $
*/
#include "sc.h"
@ -958,6 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
if (cur_console->status & BUFFER_SAVED)
return EBUSY;
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;