1
1

examples: Check return value of fstat().

CID #743297
Этот коммит содержится в:
Andreas Schneider 2013-07-14 15:01:06 +02:00
родитель 776ff528df
Коммит 351e4107ed

Просмотреть файл

@ -192,7 +192,10 @@ static int do_copy(struct location *src, struct location *dest, int recursive){
fprintf(stderr, "Invalid file pointer, error: %s\n", strerror(errno)); fprintf(stderr, "Invalid file pointer, error: %s\n", strerror(errno));
return -1; return -1;
} }
fstat(fd,&s); r = fstat(fd, &s);
if (r < 0) {
return -1;
}
size=s.st_size; size=s.st_size;
mode = s.st_mode & ~S_IFMT; mode = s.st_mode & ~S_IFMT;
filename=ssh_basename(src->path); filename=ssh_basename(src->path);