mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Move everything to negative errno return types (#1499)
This commit is contained in:
parent
2b500f194a
commit
e8cd74cab0
177 changed files with 5952 additions and 5843 deletions
|
|
@ -35,12 +35,16 @@ _open_proc_self_fd()
|
|||
int
|
||||
procfs::init()
|
||||
{
|
||||
if(g_PROCFS_DIR_FD != -1)
|
||||
int rv;
|
||||
|
||||
if(g_PROCFS_DIR_FD >= 0)
|
||||
return 0;
|
||||
|
||||
g_PROCFS_DIR_FD = fs::open(PROCFS_PATH,O_PATH|O_DIRECTORY);
|
||||
if(g_PROCFS_DIR_FD == -1)
|
||||
return -errno;
|
||||
rv = fs::open(PROCFS_PATH,O_PATH|O_DIRECTORY);
|
||||
if(rv < 0)
|
||||
return rv;
|
||||
|
||||
g_PROCFS_DIR_FD = rv;
|
||||
|
||||
#if defined(__linux__)
|
||||
::_open_proc_self_fd();
|
||||
|
|
@ -65,7 +69,7 @@ procfs::get_name(const int tid_)
|
|||
return {};
|
||||
|
||||
rv = fs::read(fd,commpath.data(),commpath.size());
|
||||
if(rv == -1)
|
||||
if(rv < 0)
|
||||
return {};
|
||||
|
||||
// Overwrite the newline with NUL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue