Move everything to negative errno return types (#1499)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled

This commit is contained in:
trapexit 2025-07-25 17:53:48 -05:00 • committed by GitHub
parent 2b500f194a
commit e8cd74cab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
177 changed files with 5952 additions and 5843 deletions

View file

@ -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