From fb2628d619747bb6c25eac38c4393ebdf9967c7e Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 8 Feb 2024 16:49:15 +0900 Subject: [PATCH] cursor-off: use pwrite for port access --- apps/cursor-off.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/cursor-off.c b/apps/cursor-off.c index 886d3df7..7c28f4d5 100644 --- a/apps/cursor-off.c +++ b/apps/cursor-off.c @@ -19,13 +19,9 @@ int main(int argc, char * argv[]) { int fd = open("/dev/port", O_RDWR); if (fd < 0) return 1; - lseek(fd, 0x3D4, SEEK_SET); - write(fd, (unsigned char[]){14}, 1); - lseek(fd, 0x3D5, SEEK_SET); - write(fd, (unsigned char[]){0xFF}, 1); - lseek(fd, 0x3D4, SEEK_SET); - write(fd, (unsigned char[]){15}, 1); - lseek(fd, 0x3D5, SEEK_SET); - write(fd, (unsigned char[]){0xFF}, 1); + pwrite(fd, (unsigned char[]){14}, 1, 0x3D4); + pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5); + pwrite(fd, (unsigned char[]){15}, 1, 0x3D4); + pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5); return 0; }