mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-19 16:16:48 +00:00
Use fatal::abort() rather than assert in places
This commit is contained in:
committed by
trapexit
parent
61365d226d
commit
7763c7384a
+3
-3
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
namespace FUSE
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user