mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Use fatal::abort() rather than assert in places
This commit is contained in:
parent
0b3600ddcf
commit
0b4ecc0226
5 changed files with 9 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue