1
1

examples: Check return value of fileno().

Этот коммит содержится в:
Andreas Schneider 2013-06-19 12:32:10 +02:00
родитель 36e4c2e5bc
Коммит 89be6d0309

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

@ -179,7 +179,11 @@ static int do_copy(struct location *src, struct location *dest, int recursive){
(void)recursive;
/* Get the file name and size*/
if(!src->is_ssh){
fd=fileno(src->file);
fd = fileno(src->file);
if (fd < 0) {
fprintf(stderr, "Invalid file pointer, error: %s\n", strerror(errno));
return -1;
}
fstat(fd,&s);
size=s.st_size;
mode = s.st_mode & ~S_IFMT;