Skip to content

Commit 6844a10

Browse files
committed
Use 0666 as default open permissions
1 parent a6c88da commit 6844a10

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/um/um_class.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ VALUE UM_open_ensure(VALUE arg) {
271271

272272
VALUE UM_open(VALUE self, VALUE pathname, VALUE flags) {
273273
struct um *machine = get_machine(self);
274-
VALUE ret = um_open(machine, pathname, NUM2INT(flags), S_IRWXU);
274+
// TODO: take optional perm (mode) arg
275+
VALUE ret = um_open(machine, pathname, NUM2INT(flags), 0666);
275276
if (rb_block_given_p()) {
276277
struct um_open_ctx ctx = { self, ret };
277278
return rb_ensure(rb_yield, ret, UM_open_ensure, (VALUE)&ctx);

test/test_um.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -992,4 +992,4 @@ def test_open_with_block
992992
assert_raises(Errno::EBADF) { machine.close(res) }
993993
assert_equal 'bar', IO.read(PATH)
994994
end
995-
end
995+
end

0 commit comments

Comments
 (0)