diff toys/mdev.c @ 367:b8c8b4827e97

Use fdlength() instead of lseek(SEEK_END).
author Rob Landley <rob@landley.net>
date Tue, 05 Jan 2010 10:45:16 -0600
parents 6773399539aa
children d51be130fda2
line wrap: on
line diff
--- a/toys/mdev.c	Tue Jan 05 10:43:36 2010 -0600
+++ b/toys/mdev.c	Tue Jan 05 10:45:16 2010 -0600
@@ -70,7 +70,7 @@
 
 		// 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;