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

@ -14,6 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "fuse_fchown.hpp"
#include "errno.hpp"
#include "fileinfo.hpp"
#include "fs_fchown.hpp"
@ -24,49 +26,41 @@
#include <unistd.h>
namespace l
static
int
_fchown(const int fd_,
const uid_t uid_,
const gid_t gid_)
{
static
int
fchown(const int fd_,
const uid_t uid_,
const gid_t gid_)
{
int rv;
int rv;
rv = fs::fchown(fd_,uid_,gid_);
if(rv == -1)
return -errno;
rv = fs::fchown(fd_,uid_,gid_);
return rv;
}
return rv;
}
namespace FUSE
int
FUSE::fchown(const uint64_t fh_,
const uid_t uid_,
const gid_t gid_)
{
int
fchown(const uint64_t fh_,
const uid_t uid_,
const gid_t gid_)
{
uint64_t fh;
const fuse_context *fc = fuse_get_context();
uint64_t fh;
const fuse_context *fc = fuse_get_context();
fh = fh_;
if(fh == 0)
{
state.open_files.cvisit(fc->nodeid,
[&](auto &val_)
{
fh = reinterpret_cast<uint64_t>(val_.second.fi);
});
}
fh = fh_;
if(fh == 0)
{
state.open_files.cvisit(fc->nodeid,
[&](auto &val_)
{
fh = reinterpret_cast<uint64_t>(val_.second.fi);
});
}
if(fh == 0)
return -ENOENT;
if(fh == 0)
return -ENOENT;
FileInfo *fi = reinterpret_cast<FileInfo*>(fh);
FileInfo *fi = reinterpret_cast<FileInfo*>(fh);
return l::fchown(fi->fd,uid_,gid_);
}
return ::_fchown(fi->fd,uid_,gid_);
}