aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/deallocvt.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-06-24 06:42:08 -0500
committerRob Landley <rob@landley.net>2014-06-24 06:42:08 -0500
commitd3cd45babc2e3bc72b53c08e48fac7f94887b72b (patch)
tree13dd2ae9977a7cd53b5d096e80c831bb9ab09d75 /toys/pending/deallocvt.c
parentfc49761a9c992a120a27cca016d6a3ed31b1f3d3 (diff)
downloadtoybox-d3cd45babc2e3bc72b53c08e48fac7f94887b72b.tar.gz
Move deallocvt.c into openvt.c, cleanup both.
Diffstat (limited to 'toys/pending/deallocvt.c')
-rw-r--r--toys/pending/deallocvt.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/toys/pending/deallocvt.c b/toys/pending/deallocvt.c
deleted file mode 100644
index a8067d59..00000000
--- a/toys/pending/deallocvt.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* deallocvt.c - Deallocate virtual terminal(s)
- *
- * Copyright 2014 Vivek Kumar Bhagat <vivek.bhagat89@gmail.com>
- *
- * No Standard.
-
-USE_DEALLOCVT(NEWTOY(deallocvt, ">1", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-
-config DEALLOCVT
- bool "deallocvt"
- depends on OPENVT
- default n
- help
- usage: deallocvt [N]
-
- Deallocate unused virtual terminal /dev/ttyN
- default value of N is 0, deallocate all unused consoles
-*/
-
-#include "toys.h"
-#include <linux/vt.h>
-
-void deallocvt_main(void)
-{
- int fd;
-
- // 0 : deallocate all unused consoles
- int vt_num = 0;
-
- if (toys.optargs[0])
- vt_num = atolx_range(toys.optargs[0], 1, 63);
-
- fd = find_console_fd();
- if (fd < 0) error_exit("can't open console");
-
- xioctl(fd, VT_DISALLOCATE, (void *)(ptrdiff_t)vt_num);
-}