While the warning is a false positive, it is possible to clarify the code by
always initializing the variable. This does also allow to make the sending
of the "beep" control sequence depend on the validity of its parameters.
I have left the redundant assignment of 0 to the now initialized variables
in place since this makes the code simpler to understand and does not add
any run-time overhead (the compiler completely removes the "else if" test
and the assignments).
There was an embedded literal escape character in a string, which messes up
diplaying the source code on a terminal that interprets ANSI sequences. The
literal escape has been replaced by \e (non-standard, but supported by all
relevant compilers, and already used in other source files in base).
MFC after: 2 weeks
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
No functional change intended.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.
Sponsored by: EMC / Isilon Storage Division
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.
Still need to add real targets under targets/ to build packages.
Differential Revision: D2796
Reviewed by: brooks imp
ability to specify the the full path name of the keymap file.
Instead leave the original search order intact, but insert the path for
newcons-specific fonts (if run on a system using newcons):
- KEYMAP_PATH in environment
- full path name
- /usr/share/vt/keymaps (only if newcons is in use!)
- /usr/share/syscons/keymaps (also as fall-back for newcons)
MFC after: 1 week
newcons specific keymap files, not prefix[2]. The result of this bug was
that kbdcontrol ignored the files in the syscons keymap directory, which
apparently still work under newcons, for most locales.
MFC after: 1 week
As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.
Reported by: Trond Endrestøl
None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.
Just take keyent_t to use an u_int to store the Unicode codepoints.
Unfortunately the keymap is now too big to be loaded using an ioctl
argument, so change the ioctl to pick a pointer.
This change breaks kbdcontrol ABI. It doesn't break X11, because X11
doesn't do anything with syscons keymaps. It just switches the device
out of K_XLATE.
Obtained from: //depot/user/ed/newcons/...
In preparation for Unicode support for the keyboard layer, we'd better
get rid of all the hardcoded 0x100/0xff constants in kbdcontrol.
Instead, add a flag called SPECIAL stored in the top bit of the integer.
Adding Unicode support is very simple now; just change u_char map[] to
u_int map[] in keyent_t, change the bounds checking in kbdcontrol to
0x1FFFFF and modify the ioctls to allow loading these new keymaps.
o Slightly change KBADDKBD and KBRELKBD ioctl() interface. Instead of passing
keyboard index pass keyboard_info_t structure with populated 'kb_unit' and
'kb_name' fields. Keyboard index is not very user-friendly and is not very
easy to obtain. Keyboard driver name and unit, on the other hand, is much
more user friendly and known almost all the time;
o Move definition of keyboard_info_t structure up;
o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
multiplexor;
o Update kbdcontrol(1) man page and document new functionality.
To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).
MFC after: 1 week
This example caused me to incorrectly believe that you must use the
generic device nodes when you can in fact use either. It's often better
to use the driver specific node.