All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>,
	xenomai@xenomai.org
Cc: xenomai-git@xenomai.org
Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : sysregd: Unmount filesystems via fusermount
Date: Wed, 07 Jan 2015 10:43:47 +0100	[thread overview]
Message-ID: <54ACFFD3.6090107@siemens.com> (raw)
In-Reply-To: <20150106100352.GB11206@hermes.click-hack.org>

On 2015-01-06 11:03, Gilles Chanteperdrix wrote:
> On Mon, Jan 05, 2015 at 04:19:28PM +0100, git repository hosting wrote:
>> +static void unmount(const char *path)
>> +{
>> +	const char cmd_tmpl[] = "/usr/bin/fusermount -uzq ";
>> +	char *cmd = malloc(sizeof(cmd_tmpl) + strlen(path));
>> +
>> +	if (cmd) {
>> +		strcpy(cmd, cmd_tmpl);
>> +		strcat(cmd, path);
>> +		system(cmd);
>> +		free(cmd);
>> +	}
>> +}
> 
> That is really ugly. Why not using asprintf ?

Good point. Wasn't fully aware of this function.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux


      reply	other threads:[~2015-01-07  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Y89RI-000705-G1@sd-51317.xenomai.org>
2015-01-06 10:03 ` [Xenomai] [Xenomai-git] Jan Kiszka : sysregd: Unmount filesystems via fusermount Gilles Chanteperdrix
2015-01-07  9:43   ` Jan Kiszka [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=54ACFFD3.6090107@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai-git@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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.