summaryrefslogtreecommitdiff
path: root/app/video
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-09-16 20:29:04 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-09-16 20:29:04 +0000
commit9a660dcaca63a88bf13982cf6f7c90ecfa312f98 (patch)
treeb484bee75824c20b34214ee371fd18532bb4e040 /app/video
parentab9a91599ced007e4aebd94a8eeb120a641453c2 (diff)
Make video -i work ootb.
video(1) uses mmap and ioctls by default, those ioctls only work on video(4) devices. If -i is passed, use read(2) instead of the mmap(2) routines, instead of requiring the user to pass also pass the -g flag.
Diffstat (limited to 'app/video')
-rw-r--r--app/video/video.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/video/video.c b/app/video/video.c
index 1b0745c32..38f4f8518 100644
--- a/app/video/video.c
+++ b/app/video/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.19 2016/06/06 19:31:22 mglocker Exp $ */
+/* $OpenBSD: video.c,v 1.20 2016/09/16 20:29:03 jca Exp $ */
/*
* Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
*
@@ -1805,6 +1805,7 @@ main(int argc, char *argv[])
err++;
} else {
vid.mode = (vid.mode & ~M_IN_DEV) | M_IN_FILE;
+ vid.mmap_on = 0; /* mmap mode does not work for files */
snprintf(vid.iofile, sizeof(vid.iofile),
optarg);
}