Mercurial > emacs
comparison src/filelock.c @ 24386:fe2294e5627d
(get_boot_time): Don't use BUFSIZ.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 23 Feb 1999 22:09:47 +0000 |
parents | 8cbfa7848416 |
children | 76205fb50ca1 |
comparison
equal
deleted
inserted
replaced
24385:92817fedff02 | 24386:fe2294e5627d |
---|---|
114 /* Try calculating the last boot time | 114 /* Try calculating the last boot time |
115 from the uptime as obtained from /proc/uptime. */ | 115 from the uptime as obtained from /proc/uptime. */ |
116 | 116 |
117 while ((fd = open ("/proc/uptime", O_RDONLY)) >= 0) | 117 while ((fd = open ("/proc/uptime", O_RDONLY)) >= 0) |
118 { | 118 { |
119 char buf[BUFSIZ]; | 119 char buf[100]; |
120 int res; | 120 int res; |
121 double upsecs; | 121 double upsecs; |
122 time_t uptime; | 122 time_t uptime; |
123 | 123 |
124 read (fd, buf, BUFSIZ); | 124 read (fd, buf, sizeof buf); |
125 close (fd); | 125 close (fd); |
126 | 126 |
127 res = sscanf (buf, "%lf", &upsecs); | 127 res = sscanf (buf, "%lf", &upsecs); |
128 | 128 |
129 /* If the current time did not tick while we were getting the | 129 /* If the current time did not tick while we were getting the |