summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ff9d11)
raw | patch | inline | side by side (parent: 5ff9d11)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 27 Aug 2006 23:55:46 +0000 (01:55 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 28 Aug 2006 03:49:35 +0000 (20:49 -0700) |
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
dir.c | patch | blob | history |
index d53d48f70c7f07a3fe5e6851467fc566b341aeb9..5a40d8ff8c99c80bf8f0484425db6022c6f7d8e9 100644 (file)
--- a/dir.c
+++ b/dir.c
int baselen,
struct exclude_list *which)
{
+ struct stat st;
int fd, i;
long size;
char *buf, *entry;
fd = open(fname, O_RDONLY);
- if (fd < 0)
+ if (fd < 0 || fstat(fd, &st) < 0)
goto err;
- size = lseek(fd, 0, SEEK_END);
- if (size < 0)
- goto err;
- lseek(fd, 0, SEEK_SET);
+ size = st.st_size;
if (size == 0) {
close(fd);
return 0;