summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ulib.c b/ulib.c
index eaa33d3..004b934 100644
--- a/ulib.c
+++ b/ulib.c
@@ -61,11 +61,11 @@ gets(char *buf, int max)
int
stat(char *n, struct stat *st)
{
- int fd = open(n, O_RDONLY);
+ int fd;
int r;
+ fd = open(n, O_RDONLY);
if (fd < 0) return -1;
-
r = fstat(fd, st);
close(fd);
return r;