X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fdebug.c;h=58a50619c423ab2ebb90fffc31d3fcf20d792b23;hp=d6e469b4cba3303693dbf31c579263f815e965e7;hb=84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0;hpb=baa5a4099425803f01fa7eb2dce40c80c9c7611e diff --git a/daemon/debug.c b/daemon/debug.c index d6e469b..58a5061 100644 --- a/daemon/debug.c +++ b/daemon/debug.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,8 +60,14 @@ static struct cmd cmds[] = { }; #endif +#if ! ENABLE_DEBUG_COMMAND +# define MAYBE_UNUSED ATTRIBUTE_UNUSED +#else +# define MAYBE_UNUSED /* empty */ +#endif + char * -do_debug (char *subcmd, char **argv) +do_debug (const char *subcmd MAYBE_UNUSED, char **argv MAYBE_UNUSED) { #if ENABLE_DEBUG_COMMAND int argc, i; @@ -157,11 +163,11 @@ debug_fds (const char *subcmd, int argc, char *const *const argv) if (S_ISLNK (statbuf.st_mode)) { r = readlink (fname, link, sizeof link - 1); if (r == -1) { - reply_with_perror ("readline: %s", fname); - fclose (fp); - free (out); - closedir (dir); - return NULL; + reply_with_perror ("readline: %s", fname); + fclose (fp); + free (out); + closedir (dir); + return NULL; } link[r] = '\0';