Use fatal::abort() rather than assert in places

This commit is contained in:
Antonio SJ Musumeci
2026-03-24 21:13:34 -04:00
committed by trapexit
parent 61365d226d
commit 7763c7384a
5 changed files with 9 additions and 10 deletions
+3 -3
View File
@@ -21,15 +21,15 @@
#if defined(__linux__)
#include "fmt/core.h"
#include "fs_openat.hpp"
#include "fatal.hpp"
#include "procfs.hpp"
#include <cassert>
int
fs::open_fd(const int fd_,
const int flags_)
{
assert(procfs::PROC_SELF_FD_FD > 0);
if(procfs::PROC_SELF_FD_FD <= 0)
fatal::abort("procfs::PROC_SELF_FD_FD must be > 0");
const int flags = (flags_ & ~O_NOFOLLOW);
+3 -1
View File
@@ -21,6 +21,7 @@
#include "fuse_readdir_factory.hpp"
#include "dirinfo.hpp"
#include "fatal.hpp"
#include "fuse_dirents.hpp"
#include "config.hpp"
@@ -108,7 +109,8 @@ FUSE::ReadDir::operator()(const fuse_req_ctx_t *ctx_,
std::shared_ptr<FUSE::ReadDirBase> readdir;
readdir = std::atomic_load(&_impl);
assert(readdir);
if(!readdir)
fatal::abort("readdir impl is null");
rv = (*readdir)(ctx_,ffi_,buf_);
if(rv == -ENOENT)
-2
View File
@@ -25,8 +25,6 @@
#include <memory>
#include <mutex>
#include <assert.h>
namespace FUSE
{
+3 -4
View File
@@ -1,10 +1,8 @@
#include "maintenance_thread.hpp"
#include "fatal.hpp"
#include "mutex.hpp"
#include "fmt/core.h"
#include <cassert>
#include <vector>
#include <pthread.h>
@@ -46,7 +44,8 @@ MaintenanceThread::setup()
int rv;
rv = pthread_create(&g_thread,NULL,_thread_loop,NULL);
assert((rv == 0) && "pthread_create failed");
if(rv != 0)
fatal::abort("pthread_create failed: rv={}",rv);
}
void