* [PATCH] um: umid: Use strdup to simplify code
@ 2015-07-08 19:15 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-08 19:15 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, linux-kernel, kernel-janitors,
Christophe JAILLET
Replace a malloc+strcpy by an equivalent strdup in order to improve
readability.
Turn a some spaces into a tab to be consistent with the rest of the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..cc9ac2e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -48,15 +48,14 @@ static int __init make_uml_dir(void)
strlcat(dir, "/", sizeof(dir));
err = -ENOMEM;
- uml_dir = malloc(strlen(dir) + 1);
+ uml_dir = strdup(dir);
if (uml_dir = NULL) {
- printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+ printf("make_uml_dir : strdup failed, errno = %d\n", errno);
goto err;
}
- strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
- printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
+ printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
err = -errno;
goto err_free;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] um: umid: Use strdup to simplify code
@ 2015-07-08 19:15 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-08 19:15 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, linux-kernel, kernel-janitors,
Christophe JAILLET
Replace a malloc+strcpy by an equivalent strdup in order to improve
readability.
Turn a some spaces into a tab to be consistent with the rest of the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..cc9ac2e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -48,15 +48,14 @@ static int __init make_uml_dir(void)
strlcat(dir, "/", sizeof(dir));
err = -ENOMEM;
- uml_dir = malloc(strlen(dir) + 1);
+ uml_dir = strdup(dir);
if (uml_dir == NULL) {
- printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+ printf("make_uml_dir : strdup failed, errno = %d\n", errno);
goto err;
}
- strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
- printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
+ printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
err = -errno;
goto err_free;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] um: umid: Use strdup to simplify code
2015-07-08 19:15 ` Christophe JAILLET
@ 2015-07-08 19:19 ` Richard Weinberger
-1 siblings, 0 replies; 12+ messages in thread
From: Richard Weinberger @ 2015-07-08 19:19 UTC (permalink / raw)
To: Christophe JAILLET, jdike
Cc: user-mode-linux-devel, linux-kernel, kernel-janitors
Am 08.07.2015 um 21:15 schrieb Christophe JAILLET:
> Replace a malloc+strcpy by an equivalent strdup in order to improve
> readability.
Makes sense!
> Turn a some spaces into a tab to be consistent with the rest of the code.
Do this in an extra patch. One logical change per patch please.
Thanks,
//richard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] um: umid: Use strdup to simplify code
@ 2015-07-08 19:19 ` Richard Weinberger
0 siblings, 0 replies; 12+ messages in thread
From: Richard Weinberger @ 2015-07-08 19:19 UTC (permalink / raw)
To: Christophe JAILLET, jdike
Cc: user-mode-linux-devel, linux-kernel, kernel-janitors
Am 08.07.2015 um 21:15 schrieb Christophe JAILLET:
> Replace a malloc+strcpy by an equivalent strdup in order to improve
> readability.
Makes sense!
> Turn a some spaces into a tab to be consistent with the rest of the code.
Do this in an extra patch. One logical change per patch please.
Thanks,
//richard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [uml-devel] [PATCH] um: umid: Use strdup to simplify code
2015-07-08 19:19 ` Richard Weinberger
(?)
@ 2015-07-08 19:56 ` Jeff Dike
2015-07-08 20:01 ` Richard Weinberger
-1 siblings, 1 reply; 12+ messages in thread
From: Jeff Dike @ 2015-07-08 19:56 UTC (permalink / raw)
To: Richard Weinberger; +Cc: Christophe JAILLET, user-mode-linux-devel
... Nice patch elided ...
I have a bit of a problem here - Christophe isn't a member of
uml-devel, so Mailman is sitting on his post until it's approved by a
list moderator, namely me.
So far, so good, except that my uml-devel password stopped working, so
I now have no ability to approve this (and throw out the reasonable
amount of spam that's also waiting for (non-)approval.
If anyone has any suggestions about regaining moderator control of
this list, please let me know.
Jeff
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [uml-devel] [PATCH] um: umid: Use strdup to simplify code
2015-07-08 19:56 ` [uml-devel] " Jeff Dike
@ 2015-07-08 20:01 ` Richard Weinberger
2015-07-08 22:11 ` Jeff Dike
0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2015-07-08 20:01 UTC (permalink / raw)
To: Jeff Dike; +Cc: Christophe JAILLET, user-mode-linux-devel
Hi Jeff,
Am 08.07.2015 um 21:56 schrieb Jeff Dike:
> ... Nice patch elided ...
>
> I have a bit of a problem here - Christophe isn't a member of
> uml-devel, so Mailman is sitting on his post until it's approved by a
> list moderator, namely me.
>
> So far, so good, except that my uml-devel password stopped working, so
> I now have no ability to approve this (and throw out the reasonable
> amount of spam that's also waiting for (non-)approval.
>
> If anyone has any suggestions about regaining moderator control of
> this list, please let me know.
I'm project manager on UML's sf.net site. Maybe I can reset it.
BTW: I'd like to move away from sf.net soon. Maybe to lists.infradead.org.
Is that okay for you?
Thanks,
//richard
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [uml-devel] [PATCH] um: umid: Use strdup to simplify code
2015-07-08 20:01 ` Richard Weinberger
@ 2015-07-08 22:11 ` Jeff Dike
0 siblings, 0 replies; 12+ messages in thread
From: Jeff Dike @ 2015-07-08 22:11 UTC (permalink / raw)
To: Richard Weinberger; +Cc: Christophe JAILLET, user-mode-linux-devel
On Wed, Jul 08, 2015 at 10:01:23PM +0200, Richard Weinberger wrote:
> BTW: I'd like to move away from sf.net soon. Maybe to lists.infradead.org.
> Is that okay for you?
Fine by me - it's your call.
Jeff
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] um: umid: Use tab instead of spaces
2015-07-08 19:15 ` Christophe JAILLET
@ 2015-07-09 5:06 ` Christophe JAILLET
-1 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-09 5:06 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, user-mode-linux-user, linux-kernel,
kernel-janitors, Christophe JAILLET
Turn some spaces into a tab to be consistent with the rest of the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..b514ead 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -56,7 +56,7 @@ static int __init make_uml_dir(void)
strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
- printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
+ printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
err = -errno;
goto err_free;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 1/2] um: umid: Use tab instead of spaces
@ 2015-07-09 5:06 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-09 5:06 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, user-mode-linux-user, linux-kernel,
kernel-janitors, Christophe JAILLET
Turn some spaces into a tab to be consistent with the rest of the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index c1dc892..b514ead 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -56,7 +56,7 @@ static int __init make_uml_dir(void)
strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
- printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
+ printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
err = -errno;
goto err_free;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] um: umid: Use strdup to simplify code
2015-07-09 5:06 ` Christophe JAILLET
(?)
@ 2015-07-09 5:06 ` Christophe JAILLET
-1 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-09 5:06 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, user-mode-linux-user, linux-kernel,
kernel-janitors, Christophe JAILLET
Replace a malloc+strcpy by an equivalent strdup in order to improve
readability.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index b514ead..cc9ac2e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -48,12 +48,11 @@ static int __init make_uml_dir(void)
strlcat(dir, "/", sizeof(dir));
err = -ENOMEM;
- uml_dir = malloc(strlen(dir) + 1);
+ uml_dir = strdup(dir);
if (uml_dir = NULL) {
- printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+ printf("make_uml_dir : strdup failed, errno = %d\n", errno);
goto err;
}
- strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [uml-devel] [PATCH 2/2] um: umid: Use strdup to simplify code
@ 2015-07-09 5:06 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-09 5:06 UTC (permalink / raw)
To: jdike, richard
Cc: Christophe JAILLET, kernel-janitors, user-mode-linux-user,
user-mode-linux-devel, linux-kernel
Replace a malloc+strcpy by an equivalent strdup in order to improve
readability.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index b514ead..cc9ac2e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -48,12 +48,11 @@ static int __init make_uml_dir(void)
strlcat(dir, "/", sizeof(dir));
err = -ENOMEM;
- uml_dir = malloc(strlen(dir) + 1);
+ uml_dir = strdup(dir);
if (uml_dir == NULL) {
- printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+ printf("make_uml_dir : strdup failed, errno = %d\n", errno);
goto err;
}
- strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
--
2.1.4
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] um: umid: Use strdup to simplify code
@ 2015-07-09 5:06 ` Christophe JAILLET
0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2015-07-09 5:06 UTC (permalink / raw)
To: jdike, richard
Cc: user-mode-linux-devel, user-mode-linux-user, linux-kernel,
kernel-janitors, Christophe JAILLET
Replace a malloc+strcpy by an equivalent strdup in order to improve
readability.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/um/os-Linux/umid.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index b514ead..cc9ac2e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -48,12 +48,11 @@ static int __init make_uml_dir(void)
strlcat(dir, "/", sizeof(dir));
err = -ENOMEM;
- uml_dir = malloc(strlen(dir) + 1);
+ uml_dir = strdup(dir);
if (uml_dir == NULL) {
- printf("make_uml_dir : malloc failed, errno = %d\n", errno);
+ printf("make_uml_dir : strdup failed, errno = %d\n", errno);
goto err;
}
- strcpy(uml_dir, dir);
if ((mkdir(uml_dir, 0777) < 0) && (errno != EEXIST)) {
printf("Failed to mkdir '%s': %s\n", uml_dir, strerror(errno));
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-07-09 5:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 19:15 [PATCH] um: umid: Use strdup to simplify code Christophe JAILLET
2015-07-08 19:15 ` Christophe JAILLET
2015-07-08 19:19 ` Richard Weinberger
2015-07-08 19:19 ` Richard Weinberger
2015-07-08 19:56 ` [uml-devel] " Jeff Dike
2015-07-08 20:01 ` Richard Weinberger
2015-07-08 22:11 ` Jeff Dike
2015-07-09 5:06 ` [PATCH 1/2] um: umid: Use tab instead of spaces Christophe JAILLET
2015-07-09 5:06 ` Christophe JAILLET
2015-07-09 5:06 ` [PATCH 2/2] um: umid: Use strdup to simplify code Christophe JAILLET
2015-07-09 5:06 ` Christophe JAILLET
2015-07-09 5:06 ` [uml-devel] " Christophe JAILLET
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.