aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2010-03-23 03:09:15 +0100
committermaximilian attems <max@stro.at>2010-03-23 03:34:26 +0100
commiteb13bfbd0acd58bdc0fbef42d367a92d58e1be62 (patch)
treee826abce8e52335bdbe4a39ede9f5a55cdb20339
parente8070f0bc724fb307b45c5c23e53f5fce5cc4083 (diff)
downloadklibc-eb13bfbd0acd58bdc0fbef42d367a92d58e1be62.tar.gz
[klibc] nfsmount: use dprintf on DEBUG
same switch as ipconfig. nuke unused include of ipconfig.h in nfsroot.c Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/kinit/nfsmount/mount.c6
-rw-r--r--usr/kinit/nfsmount/nfsmount.h16
-rw-r--r--usr/kinit/nfsmount/portmap.c4
-rw-r--r--usr/kinit/nfsmount/sunrpc.c6
-rw-r--r--usr/kinit/nfsroot.c1
5 files changed, 12 insertions, 21 deletions
diff --git a/usr/kinit/nfsmount/mount.c b/usr/kinit/nfsmount/mount.c
index a55af911193ca..d0eca8a9ea019 100644
--- a/usr/kinit/nfsmount/mount.c
+++ b/usr/kinit/nfsmount/mount.c
@@ -93,7 +93,7 @@ static inline void dump_params(uint32_t server,
(void)path;
(void)data;
-#ifdef NFS_DEBUG
+#ifdef DEBUG
struct in_addr addr = { server };
printf("NFS params:\n");
@@ -121,7 +121,7 @@ static inline void dump_fh(const char *data, int len)
(void)data;
(void)len;
-#ifdef NFS_DEBUG
+#ifdef DEBUG
int i = 0;
int max = len - (len % 8);
@@ -329,7 +329,7 @@ int nfs_mount(const char *pathname, const char *hostname,
goto bail;
}
- DEBUG(("Mounted %s on %s\n", pathname, path));
+ dprintf("Mounted %s on %s\n", pathname, path);
goto done;
diff --git a/usr/kinit/nfsmount/nfsmount.h b/usr/kinit/nfsmount/nfsmount.h
index abe04c2bfa78e..7b28dedf124e6 100644
--- a/usr/kinit/nfsmount/nfsmount.h
+++ b/usr/kinit/nfsmount/nfsmount.h
@@ -17,19 +17,11 @@ enum nfs_proto {
/* masked with NFS_MOUNT_FLAGMASK before mount() call */
#define NFS_MOUNT_KLIBC_RONLY 0x00010000U
-/*
- * Note for gcc 3.2.2:
- *
- * If you're turning on debugging, make sure you get rid of -Os from
- * the gcc command line, or else ipconfig will fail to link.
- */
-#undef NFS_DEBUG
-
-#undef DEBUG
-#ifdef NFS_DEBUG
-#define DEBUG(x) printf x
+
+#ifdef DEBUG
+# define dprintf printf
#else
-#define DEBUG(x) do { } while(0)
+# define dprintf(...) ((void)0)
#endif
#ifndef MNTPROC_MNT
diff --git a/usr/kinit/nfsmount/portmap.c b/usr/kinit/nfsmount/portmap.c
index 2f111d90a3e1d..ff79d042621fe 100644
--- a/usr/kinit/nfsmount/portmap.c
+++ b/usr/kinit/nfsmount/portmap.c
@@ -62,8 +62,8 @@ uint32_t portmap(uint32_t server, uint32_t program, uint32_t version, uint32_t p
port = ntohl(reply.port);
bail:
- DEBUG(("Port for %d/%d[%s]: %d\n", program, version,
- proto == IPPROTO_TCP ? "tcp" : "udp", port));
+ dprintf("Port for %d/%d[%s]: %d\n", program, version,
+ proto == IPPROTO_TCP ? "tcp" : "udp", port);
if (clnt) {
client_free(clnt);
diff --git a/usr/kinit/nfsmount/sunrpc.c b/usr/kinit/nfsmount/sunrpc.c
index 6607cf7233aed..72835196edef8 100644
--- a/usr/kinit/nfsmount/sunrpc.c
+++ b/usr/kinit/nfsmount/sunrpc.c
@@ -120,14 +120,14 @@ static int rpc_call_udp(struct client *clnt, struct rpc *rpc)
goto bail;
}
if (ret == 0) {
- DEBUG(("Timeout #%d\n", i + 1));
+ dprintf("Timeout #%d\n", i + 1);
break;
}
if ((ret = rpc_do_reply(clnt, rpc, UDP_HDR_OFF)) == 0) {
goto done;
} else {
- DEBUG(("Failed on try #%d - retrying\n",
- i + 1));
+ dprintf("Failed on try #%d - retrying\n",
+ i + 1);
}
}
}
diff --git a/usr/kinit/nfsroot.c b/usr/kinit/nfsroot.c
index 9930fd5ab401b..221cecd0dcf14 100644
--- a/usr/kinit/nfsroot.c
+++ b/usr/kinit/nfsroot.c
@@ -6,7 +6,6 @@
#include <string.h>
#include <assert.h>
-#include "ipconfig.h"
#include "kinit.h"
#include "netdev.h"
#include "nfsmount.h"