Commit f5d961d4 authored by conrad's avatar conrad

pulled file related seek stuff into an oggz->file check, and added a

check for io seek


git-svn-id: http://svn.annodex.net/liboggz/trunk@393 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 3a6e978c
......@@ -811,45 +811,46 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t unit_target)
return -1;
}
if (oggz->file == NULL) {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
if ((fd = fileno (oggz->file)) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (oggz->file != NULL) {
if ((fd = fileno (oggz->file)) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (fstat (fd, &statbuf) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (fstat (fd, &statbuf) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
#if 0
#ifndef WIN32
if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode)) {
offset_end = statbuf.st_size;
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode)) {
offset_end = statbuf.st_size;
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
#else
if (statbuf.st_mode & S_IFREG) {
offset_end = statbuf.st_size;
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
if (statbuf.st_mode & S_IFREG) {
offset_end = statbuf.st_size;
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
#endif
#else
if (oggz_stat_regular (statbuf.st_mode)) {
offset_end = statbuf.st_size;
if (oggz_stat_regular (statbuf.st_mode)) {
offset_end = statbuf.st_size;
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
}
#endif
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
return -1;
if (oggz->io == NULL || oggz->io->seek == NULL)
/* No file, and no io seek method */
return -1;
}
#endif
if (unit_target == reader->current_unit) {
return (long)reader->current_unit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment