From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: xenomai@xenomai.org
Cc: xenomai-git@xenomai.org
Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : sysregd: Unmount filesystems via fusermount
Date: Tue, 6 Jan 2015 11:03:52 +0100 [thread overview]
Message-ID: <20150106100352.GB11206@hermes.click-hack.org> (raw)
In-Reply-To: <E1Y89RI-000705-G1@sd-51317.xenomai.org>
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 ?
--
Gilles.
next parent reply other threads:[~2015-01-06 10:03 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 ` Gilles Chanteperdrix [this message]
2015-01-07 9:43 ` [Xenomai] [Xenomai-git] Jan Kiszka : sysregd: Unmount filesystems via fusermount Jan Kiszka
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=20150106100352.GB11206@hermes.click-hack.org \
--to=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.