aboutsummaryrefslogtreecommitdiff
path: root/toys/mdev.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2010-01-05 10:45:16 -0600
committerRob Landley <rob@landley.net>2010-01-05 10:45:16 -0600
commit2de1d1a618d4b9c069885100618dd17fd9b0113c (patch)
tree2001cd78399a6df4f7ea27deaf3523ee0452aa8d /toys/mdev.c
parent53c75045868da4cbc1a20b70d0a0711ae052344c (diff)
downloadtoybox-2de1d1a618d4b9c069885100618dd17fd9b0113c.tar.gz
Use fdlength() instead of lseek(SEEK_END).
Diffstat (limited to 'toys/mdev.c')
-rw-r--r--toys/mdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/mdev.c b/toys/mdev.c
index 39f66356..b6444088 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;