From 4c07ec695fcc24d67a0d095827a34cb7f5a1f5e1 Mon Sep 17 00:00:00 2001
From: Urias McCullough <umccullough@gmail.com>
Date: Sat, 28 Jan 2012 17:37:31 -0800
Subject: [PATCH 1/5] Conditionally define DEBUG if it's not already defined in NBD
* This allows building with DEBUG=2 and avoiding warnings.
---
src/add-ons/kernel/bus_managers/firewire/fwdebug.h | 5 ++++-
src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c | 5 +++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/add-ons/kernel/bus_managers/firewire/fwdebug.h b/src/add-ons/kernel/bus_managers/firewire/fwdebug.h
index b7131a3..37eec62 100644
a
|
b
|
|
8 | 8 | #define __FWDEBUG_H |
9 | 9 | |
10 | 10 | #include <KernelExport.h> |
11 | | #define DEBUG 1 |
| 11 | |
| 12 | #ifndef DEBUG |
| 13 | #define DEBUG 1 |
| 14 | #endif |
12 | 15 | |
13 | 16 | #ifdef DEBUG |
14 | 17 | #define TRACE(a...) dprintf("firewire: " a) |
diff --git a/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c b/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd.c
index d2e5e7b..9d4431a 100644
a
|
b
|
|
22 | 22 | #include <ksocket.h> |
23 | 23 | #include <netinet/in.h> |
24 | 24 | |
25 | | //#define DEBUG 1 |
26 | 25 | |
27 | 26 | /* on the first open(), open ourselves for some seconds, |
28 | 27 | * to avoid trying to reconnect and failing on a 2nd open, |
… |
… |
|
52 | 51 | #define mutex_unlock UNLOCK |
53 | 52 | #endif |
54 | 53 | |
55 | | #define DEBUG 1 |
| 54 | #ifndef DEBUG |
| 55 | #define DEBUG 1 |
| 56 | #endif |
56 | 57 | |
57 | 58 | #include "nbd.h" |
58 | 59 | |