Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] makedevs: Do not return error if the fifo exisits
@ 2013-10-01 16:51 Saul Wold
  2013-10-01 16:56 ` Phil Blundell
  2013-10-01 17:01 ` Mark Hatle
  0 siblings, 2 replies; 4+ messages in thread
From: Saul Wold @ 2013-10-01 16:51 UTC (permalink / raw)
  To: openembedded-core

This ensures that makedevs will not cause image creation failures
when it encounters a pipe (fifo) that exists from a previous image.
The other file/device creation code either ignore this error or check
for file type.

[YOCTO #5288]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
index 5d2c45b..7b0487f 100644
--- a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
+++ b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
@@ -274,7 +274,7 @@ static void add_new_file(char *name, char *path, unsigned long uid,
 static void add_new_fifo(char *name, char *path, unsigned long uid,
 				  unsigned long gid, unsigned long mode)
 {
-	if (mknod(path, mode, 0))
+	if (mknod(path, mode, 0) && errno != EEXIST)
 		error_msg_and_die("%s: file can not be created with mknod!", path);
 	chown(path, uid, gid);
 //	printf("File: %s %s  UID: %ld  GID: %ld  MODE: %04lo\n",
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: Do not return error if the fifo exisits
  2013-10-01 16:51 [PATCH] makedevs: Do not return error if the fifo exisits Saul Wold
@ 2013-10-01 16:56 ` Phil Blundell
  2013-10-01 17:07   ` Khem Raj
  2013-10-01 17:01 ` Mark Hatle
  1 sibling, 1 reply; 4+ messages in thread
From: Phil Blundell @ 2013-10-01 16:56 UTC (permalink / raw)
  To: Saul Wold; +Cc: openembedded-core

On Tue, 2013-10-01 at 09:51 -0700, Saul Wold wrote:
>  static void add_new_fifo(char *name, char *path, unsigned long uid,
>  				  unsigned long gid, unsigned long mode)
>  {
> -	if (mknod(path, mode, 0))
> +	if (mknod(path, mode, 0) && errno != EEXIST)
>  		error_msg_and_die("%s: file can not be created with mknod!", path);

Will this do the right thing if the mode has changed from the old to the
new versions?

p.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: Do not return error if the fifo exisits
  2013-10-01 16:51 [PATCH] makedevs: Do not return error if the fifo exisits Saul Wold
  2013-10-01 16:56 ` Phil Blundell
@ 2013-10-01 17:01 ` Mark Hatle
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Hatle @ 2013-10-01 17:01 UTC (permalink / raw)
  To: openembedded-core

On 10/1/13 11:51 AM, Saul Wold wrote:
> This ensures that makedevs will not cause image creation failures
> when it encounters a pipe (fifo) that exists from a previous image.
> The other file/device creation code either ignore this error or check
> for file type.
>
> [YOCTO #5288]
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>   meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
> index 5d2c45b..7b0487f 100644
> --- a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
> +++ b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
> @@ -274,7 +274,7 @@ static void add_new_file(char *name, char *path, unsigned long uid,
>   static void add_new_fifo(char *name, char *path, unsigned long uid,
>   				  unsigned long gid, unsigned long mode)
>   {
> -	if (mknod(path, mode, 0))
> +	if (mknod(path, mode, 0) && errno != EEXIST)
>   		error_msg_and_die("%s: file can not be created with mknod!", path);
>   	chown(path, uid, gid);
>   //	printf("File: %s %s  UID: %ld  GID: %ld  MODE: %04lo\n",
>

Ya, I'm happy with this.  It avoids recreating it if it exists.. no error.

No idea if a warning is reasonable in this case, but I'm happy with the change.

--Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] makedevs: Do not return error if the fifo exisits
  2013-10-01 16:56 ` Phil Blundell
@ 2013-10-01 17:07   ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2013-10-01 17:07 UTC (permalink / raw)
  To: Phil Blundell; +Cc: openembedded-core


On Oct 1, 2013, at 9:56 AM, Phil Blundell <pb@pbcl.net> wrote:

> On Tue, 2013-10-01 at 09:51 -0700, Saul Wold wrote:
>> static void add_new_fifo(char *name, char *path, unsigned long uid,
>> 				  unsigned long gid, unsigned long mode)
>> {
>> -	if (mknod(path, mode, 0))
>> +	if (mknod(path, mode, 0) && errno != EEXIST)
>> 		error_msg_and_die("%s: file can not be created with mknod!", path);
> 
> Will this do the right thing if the mode has changed from the old to the
> new versions?

and it wont catch dangling symlinks anymore

> 
> p.
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-01 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 16:51 [PATCH] makedevs: Do not return error if the fifo exisits Saul Wold
2013-10-01 16:56 ` Phil Blundell
2013-10-01 17:07   ` Khem Raj
2013-10-01 17:01 ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox