All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Do not fork daemon when dmeventd cannot be found.
Date: Fri, 05 Jun 2009 19:41:08 +0200	[thread overview]
Message-ID: <87bpp2tw7f.fsf@mornfall.net> (raw)
In-Reply-To: <4A291FE1.6010006@redhat.com> (Milan Broz's message of "Fri, 05 Jun 2009 15:38:41 +0200")

Hi!

Milan Broz <mbroz@redhat.com> writes:
> diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
> index 2650cf0..dae76d3 100644
> --- a/daemons/dmeventd/libdevmapper-event.c
> +++ b/daemons/dmeventd/libdevmapper-event.c
> @@ -425,6 +425,12 @@ static int _start_daemon(struct dm_event_fifos *fifos)
>  
>        start_server:
>  	/* server is not running */
> +
> +	if (stat(DMEVENTD_PATH, &statbuf)) {
> +		log_error("Unable to find dmeventd.");
> +		return_0;
> +	}
Although not exactly spectacular, I guess this is fine. Just one thing, there's
an execvp later for DMEVENTD_PATH, so this may actually not be really a safe
check (DMEVENTD_PATH -> "dmeventd" should work without this check, but will
break with it).

Yours,
   Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation



      reply	other threads:[~2009-06-05 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 13:38 [PATCH] Do not fork daemon when dmeventd cannot be found Milan Broz
2009-06-05 17:41 ` Petr Rockai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bpp2tw7f.fsf@mornfall.net \
    --to=prockai@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.