From 2de1d1a618d4b9c069885100618dd17fd9b0113c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 5 Jan 2010 10:45:16 -0600 Subject: [PATCH] Use fdlength() instead of lseek(SEEK_END). --- toys/mdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/mdev.c b/toys/mdev.c index 39f6635..b644408 100644 --- a/toys/mdev.c +++ b/toys/mdev.c @@ -70,7 +70,7 @@ static void make_device(char *path) // mmap the config file if (-1!=(fd = open("/etc/mdev.conf", O_RDONLY))) { - len = lseek(fd, 0, SEEK_END); + len = fdlength(fd); conf = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); if (conf) { int line = 0; -- 2.7.4