Avoid referencing __FILE__ - that value changes depending on the user's build setting of OUT. The function and line number are sufficient.
Also, use panic() instead of looping forever.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/virtio-ring.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/virtio-ring.c b/src/virtio-ring.c index 0883330..9d46c41 100644 --- a/src/virtio-ring.c +++ b/src/virtio-ring.c @@ -21,10 +21,8 @@ #include "biosvar.h" // GET_GLOBAL #include "util.h" // dprintf
-#define BUG() do { \ - dprintf(1, "BUG: failure at %s:%d/%s()!\n", \ - __FILE__, __LINE__, __func__); \ - while(1); \ +#define BUG() do { \ + panic("BUG: failure at %d/%s()!\n", __LINE__, __func__); \ } while (0) #define BUG_ON(condition) do { if (condition) BUG(); } while (0)