Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
4bc654d8
Commit
4bc654d8
authored
Oct 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cdf82174
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
wcfs/internal/wcfs_misc.cpp
wcfs/internal/wcfs_misc.cpp
+3
-3
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+8
-2
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+3
-3
No files found.
wcfs/internal/wcfs_misc.cpp
View file @
4bc654d8
...
...
@@ -22,11 +22,11 @@
// os::
namespace
os
{
tuple
<
File
,
error
>
open
(
const
string
&
path
)
{
tuple
<
File
,
error
>
open
(
const
string
&
path
,
int
flags
,
mode_t
mode
)
{
File
f
=
{.
fd
=
-
1
,
path
=
path
};
int
err
=
std
::
open
(
path
.
c_str
(),
O_RDONLY
);
// XXX mode
int
err
=
std
::
open
(
path
.
c_str
(),
flags
,
mode
);
if
(
err
!=
0
)
return
f
,
f
.
_errno
();
return
f
,
f
.
_errno
(
"open"
);
}
error
File
::
close
()
{
...
...
wcfs/internal/wcfs_misc.h
View file @
4bc654d8
...
...
@@ -46,6 +46,10 @@ struct error {
}
};
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
// os::
namespace
os
{
...
...
@@ -60,8 +64,10 @@ struct File {
};
// open opens file @path.
// XXX mode
tuple
<
File
,
error
>
open
(
const
string
&
path
);
tuple
<
File
,
error
>
open
(
const
string
&
path
,
int
flags
=
O_RDONLY
,
mode_t
mode
=
S_IRUSR
|
S_IWUSR
|
S_IXUSR
|
S_IRGRP
|
S_IWGRP
|
S_IXGRP
|
S_IROTH
|
S_IWOTH
|
S_IXOTH
);
}
// os::
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
4bc654d8
...
...
@@ -254,7 +254,7 @@ error _Mapping::_remmapblk(int64_t blk, Tid at) {
else
{
// TODO share @rev fd until wconn is resynced?
tie
(
fsfile
,
err
)
=
f
->
wconn
->
_wc
->
_open
(
fmt
::
sprintf
(
"@%s/bigfile/%s"
,
h_
(
at
),
h_
(
f
->
foid
))
,
"rb"
);
fmt
::
sprintf
(
"@%s/bigfile/%s"
,
h_
(
at
),
h_
(
f
->
foid
)));
if
(
err
!=
nil
)
return
err
;
defer
(
fsfile
.
close
);
...
...
@@ -289,10 +289,10 @@ string WCFS::_path(const string &obj) {
return
wc
->
mountpoint
+
"/"
+
obj
;
}
tuple
<
os
::
File
,
error
>
WCFS
::
_open
(
const
string
&
path
/*, XXX mode*/
)
{
tuple
<
os
::
File
,
error
>
WCFS
::
_open
(
const
string
&
path
,
int
flags
=
O_RDONLY
)
{
WCFS
*
wc
=
this
;
string
path_
=
wc
->
_path
(
path
);
return
os
::
open
(
path_
/*, XXX mode*/
);
return
os
::
open
(
path_
,
flags
);
}
...
...
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