1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
--- vlock.c.orig Sun Oct 8 18:03:19 2000
+++ vlock.c Sun Oct 8 18:03:24 2000
@@ -14,12 +14,10 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
-#include <getopt.h>
#include <termios.h>
#include <signal.h>
-#include <sys/vt.h>
-#include <sys/kd.h>
#include <sys/ioctl.h>
+#include <sys/consio.h>
#include "vlock.h"
#include "version.h"
@@ -37,20 +35,12 @@
int main(int argc, char **argv) {
- static struct option long_options[] = { /* For parsing long arguments */
- {"current", 0, &o_lock_all, 0},
- {"all", 0, &o_lock_all, 1},
- {"version", no_argument, 0, O_VERSION},
- {"help", no_argument, 0, O_HELP},
- {0, 0, 0, 0},
- };
int option_index; /* Unused */
int c;
struct vt_mode vtm;
/* First we parse all the command line arguments */
- while ((c = getopt_long(argc, argv, "acvh",
- long_options, &option_index)) != -1) {
+ while ((c = getopt(argc, argv, "acvh")) != -1) {
switch(c) {
case 'c':
o_lock_all = 0;
@@ -107,6 +97,7 @@
vtm.mode = VT_PROCESS;
vtm.relsig = SIGUSR1; /* handled by release_vt() */
vtm.acqsig = SIGUSR2; /* handled by acquire_vt() */
+ vtm.frsig = SIGUSR1; /* needed by FreeBSD */
ioctl(vfd, VT_SETMODE, &vtm);
}
|