diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-24 19:31:53 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-24 19:31:53 +0000 |
commit | 221f419b42a2a2a89943198d51215b15c819a456 (patch) | |
tree | 862257d98451d7a87e8e7683a6a702d2e4f6a866 /usr.sbin/sysinstall/menus.c | |
parent | ea4f82e353a9946587bb951abdf055807de19e85 (diff) | |
download | FreeBSD-src-221f419b42a2a2a89943198d51215b15c819a456.zip FreeBSD-src-221f419b42a2a2a89943198d51215b15c819a456.tar.gz |
I need to learn to read man pages more closely. readlink() does NOT null
append the return string (bleah!) so you need to do it yourself. This
explains why Bus and PS/2 meece weren't displayed in the Mouse selection
menu.
Diffstat (limited to 'usr.sbin/sysinstall/menus.c')
-rw-r--r-- | usr.sbin/sysinstall/menus.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 4d85fae..8c28473 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -328,18 +328,14 @@ DMenu MenuDocumentation = { static int whichMouse(dialogMenuItem *self) { + int i; char buf[BUFSIZ]; - if (!file_readable("/dev/mouse")) { - msgDebug("No /dev/mouse device!\n"); + if (!file_readable("/dev/mouse")) return FALSE; - } - if (readlink("/dev/mouse", buf, sizeof buf) == -1) { - msgDebug("Can't read /dev/mouse symlink!\n"); + if ((i = readlink("/dev/mouse", buf, sizeof buf)) == -1) return FALSE; - } - if (isDebug) - msgDebug("The evil link value is `%s'\n", buf); + buf[i] = '\0'; if (!strcmp(self->prompt, "COM1")) return !strcmp(buf, "/dev/cuaa0"); else if (!strcmp(self->prompt, "COM2")) |