1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

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 Somers 1997-07-09 14:10:19 +00:00
parent 0206d3bdb0
commit b73937137c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27293
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;