[lxc-devel] [PATCH 3/9] lxc_user_nic: report strerror(errno)
Stéphane Graber
stgraber at ubuntu.com
Tue Nov 19 21:50:42 UTC 2013
On Tue, Nov 19, 2013 at 04:17:46PM +0000, Serge Hallyn wrote:
> From: Serge Hallyn <serge.hallyn at ubuntu.com>
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/lxc/lxc_user_nic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c
> index da3ae74..8c73b55 100644
> --- a/src/lxc/lxc_user_nic.c
> +++ b/src/lxc/lxc_user_nic.c
> @@ -633,7 +633,7 @@ bool cull_entries(int fd, char *me, char *t, char *br)
> return true;
> buf = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
> if (buf == MAP_FAILED) {
> - fprintf(stderr, "Failed to create mapping: error %d\n", errno);
> + fprintf(stderr, "Failed to create mapping: %s\n", strerror(errno));
> return false;
> }
>
> @@ -718,7 +718,7 @@ bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br, int all
> fprintf(stderr, "Failed to set new file size\n");
> buf = mmap(NULL, len + slen, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
> if (buf == MAP_FAILED) {
> - fprintf(stderr, "Failed to create mapping after extending: error %d\n", errno);
> + fprintf(stderr, "Failed to create mapping after extending: %s\n", strerror(errno));
> if (lxc_netdev_delete_by_name(*nicname) != 0)
> fprintf(stderr, "Error unlinking %s!\n", *nicname);
> return false;
> --
> 1.8.3.2
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131119/569cccc7/attachment.pgp>
More information about the lxc-devel
mailing list