Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
828551f8
Commit
828551f8
authored
Oct 20, 2015
by
Tomoyuki Sahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
off_t can be larger than mrb_int.
parent
db7d8296
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/io.c
src/io.c
+8
-4
No files found.
src/io.c
View file @
828551f8
...
...
@@ -525,7 +525,8 @@ mrb_value
mrb_io_sysseek
(
mrb_state
*
mrb
,
mrb_value
io
)
{
struct
mrb_io
*
fptr
;
mrb_int
pos
,
offset
,
whence
=
-
1
;
off_t
pos
;
mrb_int
offset
,
whence
=
-
1
;
mrb_get_args
(
mrb
,
"i|i"
,
&
offset
,
&
whence
);
if
(
whence
<
0
)
{
...
...
@@ -534,11 +535,14 @@ mrb_io_sysseek(mrb_state *mrb, mrb_value io)
fptr
=
(
struct
mrb_io
*
)
mrb_get_datatype
(
mrb
,
io
,
&
mrb_io_type
);
pos
=
lseek
(
fptr
->
fd
,
offset
,
whence
);
if
(
pos
<
0
)
{
if
(
pos
==
-
1
)
{
mrb_sys_fail
(
mrb
,
"sysseek"
);
}
if
(
pos
>
MRB_INT_MAX
)
{
return
mrb_float_value
(
mrb
,
(
mrb_float
)
pos
);
}
else
{
return
mrb_fixnum_value
(
pos
);
}
}
mrb_value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment