mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bd670062c4
commit
f1a3be3565
1 changed files with 25 additions and 25 deletions
50
io.c
50
io.c
|
@ -10970,8 +10970,8 @@ nogvl_fcopyfile(struct copy_stream_struct *stp)
|
|||
int ret;
|
||||
|
||||
if (stp->copy_length >= (off_t)0) {
|
||||
/* copy_length can't be specified in copyfile(3) */
|
||||
return 0;
|
||||
/* copy_length can't be specified in copyfile(3) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = fstat(stp->src_fd, &sb);
|
||||
|
@ -10996,15 +10996,15 @@ nogvl_fcopyfile(struct copy_stream_struct *stp)
|
|||
if (stp->src_offset > (off_t)0) {
|
||||
off_t r;
|
||||
|
||||
/* get current offset */
|
||||
errno = 0;
|
||||
cur = lseek(stp->src_fd, 0, SEEK_CUR);
|
||||
if (cur < (off_t)0 && errno) {
|
||||
stp->error_no = errno;
|
||||
/* get current offset */
|
||||
errno = 0;
|
||||
cur = lseek(stp->src_fd, 0, SEEK_CUR);
|
||||
if (cur < (off_t)0 && errno) {
|
||||
stp->error_no = errno;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
errno = 0;
|
||||
r = lseek(stp->src_fd, stp->src_offset, SEEK_SET);
|
||||
if (r < (off_t)0 && errno) {
|
||||
stp->error_no = errno;
|
||||
|
@ -11017,22 +11017,22 @@ nogvl_fcopyfile(struct copy_stream_struct *stp)
|
|||
copyfile_state_get(stp->copyfile_state, COPYFILE_STATE_COPIED, &ss); /* get copied bytes */
|
||||
|
||||
if (ret == 0) { /* success */
|
||||
stp->total = ss;
|
||||
if (stp->src_offset > (off_t)0) {
|
||||
off_t r;
|
||||
errno = 0;
|
||||
/* reset offset */
|
||||
r = lseek(stp->src_fd, cur, SEEK_SET);
|
||||
if (r < (off_t)0 && errno) {
|
||||
stp->error_no = errno;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
stp->total = ss;
|
||||
if (stp->src_offset > (off_t)0) {
|
||||
off_t r;
|
||||
errno = 0;
|
||||
/* reset offset */
|
||||
r = lseek(stp->src_fd, cur, SEEK_SET);
|
||||
if (r < (off_t)0 && errno) {
|
||||
stp->error_no = errno;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case ENOTSUP:
|
||||
case EPERM:
|
||||
case EINVAL:
|
||||
case ENOTSUP:
|
||||
case EPERM:
|
||||
case EINVAL:
|
||||
return 0;
|
||||
}
|
||||
stp->syserr = "fcopyfile";
|
||||
|
@ -11355,7 +11355,7 @@ nogvl_copy_stream_func(void *arg)
|
|||
#ifdef HAVE_FCOPYFILE
|
||||
ret = nogvl_fcopyfile(stp);
|
||||
if (ret != 0)
|
||||
goto finish; /* error or success */
|
||||
goto finish; /* error or success */
|
||||
#endif
|
||||
|
||||
#ifdef USE_SENDFILE
|
||||
|
@ -11568,7 +11568,7 @@ copy_stream_finalize(VALUE arg)
|
|||
|
||||
#ifdef HAVE_FCOPYFILE
|
||||
if (stp->copyfile_state) {
|
||||
copyfile_state_free(stp->copyfile_state);
|
||||
copyfile_state_free(stp->copyfile_state);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue