fix use of assert() when NDEBUG is defined
assert() body is not executed if NDEBUG is defined.
This commit is contained in:
parent
45b4ef924b
commit
2abde7a3f3
9
buse.c
9
buse.c
|
@ -91,13 +91,16 @@ int buse_main(const char* dev_file, const struct buse_operations *aop, void *use
|
||||||
struct nbd_reply reply;
|
struct nbd_reply reply;
|
||||||
void *chunk;
|
void *chunk;
|
||||||
|
|
||||||
assert(!socketpair(AF_UNIX, SOCK_STREAM, 0, sp));
|
err = socketpair(AF_UNIX, SOCK_STREAM, 0, sp);
|
||||||
|
assert(!err);
|
||||||
|
|
||||||
nbd = open(dev_file, O_RDWR);
|
nbd = open(dev_file, O_RDWR);
|
||||||
assert(nbd != -1);
|
assert(nbd != -1);
|
||||||
|
|
||||||
assert(ioctl(nbd, NBD_SET_SIZE, aop->size) != -1);
|
err = ioctl(nbd, NBD_SET_SIZE, aop->size);
|
||||||
assert(ioctl(nbd, NBD_CLEAR_SOCK) != -1);
|
assert(err != -1);
|
||||||
|
err = ioctl(nbd, NBD_CLEAR_SOCK);
|
||||||
|
assert(err != -1);
|
||||||
|
|
||||||
if (!fork()) {
|
if (!fork()) {
|
||||||
/* The child needs to continue setting things up. */
|
/* The child needs to continue setting things up. */
|
||||||
|
|
Loading…
Reference in New Issue