Re: [Nbd] [PATCH] nbd-server: add setproctitle support
- To: "Dmitry V. Levin" <ldv@...1147...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] [PATCH] nbd-server: add setproctitle support
- From: Wouter Verhelst <w@...112...>
- Date: Thu, 28 Jun 2012 01:08:30 +0200
- Message-id: <20120627230830.GC7082@...3...>
- In-reply-to: <20120624230806.GC28298@...1147...>
- References: <20120624230806.GC28298@...1147...>
On Mon, Jun 25, 2012 at 03:08:06AM +0400, Dmitry V. Levin wrote:
> +#if USE_SETPROCTITLE
> +# ifdef HAVE_SETPROCTITLE_H
> +# include <setproctitle.h>
> +# endif
> +#endif
This means <setproctitle.h> is only included if we have it, and the user
asked us to compile it in.
> /** Default position of the config file */
> #ifndef SYSCONFDIR
> #define SYSCONFDIR "/etc"
> @@ -2249,6 +2255,9 @@ handle_connection(GArray *servers, int net, SERVER *serve, CLIENT *client)
>
> msg4(LOG_INFO, "Starting to serve %s for %s",
> client->exportname, client->clientname);
> +#if USE_SETPROCTITLE
> + setproctitle("%s", client->clientname);
> +#endif
This means we try to compile it in if the user asked us to do so,
regardless of whether the header is available.
That's a bug waiting to happen.
Additionally, I'm not convinced we need a compile-time option for this.
What's your reason for doing it that way?
--
The volume of a pizza of thickness a and radius z can be described by
the following formula:
pi zz a
Reply to: