All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix libxc not to hide real errno with EBADF
@ 2006-08-04 21:13 Steven Rostedt
  2006-08-04 21:17 ` Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2006-08-04 21:13 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

I'm currently looking for a cause of a bug that's giving me an invalid 
argument on an ioctl call with libxc. But before I found where the 
problem was I was constantly getting a Bad File Descriptor error.  Well 
that is because the clean up of gzclose is done after the file 
descriptor that gzdopen used is closed when it doesn't need to be.  This 
patch allows for proper clean up and the correct errno to be presented.

-- Steve

Signed-off-by: Steven Rostedt <srostedt@redhat.com>

(this may have white space damage, so I'm attaching the same patch as 
well. Haven't yet figured out how to do proper inline patches in 
thunderbird)

diff -r 9632ececc8f4 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c	Wed Aug 02 10:13:30 2006 +0100
+++ b/tools/libxc/xc_linux_build.c	Fri Aug 04 17:10:30 2006 -0400
@@ -1373,10 +1373,10 @@ int xc_linux_build(int xc_handle,
 
  error_out:
     free(image);
-    if ( fd >= 0 )
+    if ( initrd_info.type == INITRD_file && initrd_info.u.file_handle )
+        gzclose(initrd_info.u.file_handle);
+    else if ( fd >= 0 )
         close(fd);
-    if ( initrd_info.u.file_handle )
-        gzclose(initrd_info.u.file_handle);
 
     return sts;
 }



[-- Attachment #2: libxc-badfd.patch --]
[-- Type: text/x-patch, Size: 561 bytes --]

diff -r 9632ececc8f4 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c	Wed Aug 02 10:13:30 2006 +0100
+++ b/tools/libxc/xc_linux_build.c	Fri Aug 04 17:10:30 2006 -0400
@@ -1373,10 +1373,10 @@ int xc_linux_build(int xc_handle,
 
  error_out:
     free(image);
-    if ( fd >= 0 )
+    if ( initrd_info.type == INITRD_file && initrd_info.u.file_handle )
+        gzclose(initrd_info.u.file_handle);
+    else if ( fd >= 0 )
         close(fd);
-    if ( initrd_info.u.file_handle )
-        gzclose(initrd_info.u.file_handle);
 
     return sts;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] fix libxc not to hide real errno with EBADF
  2006-08-04 21:13 [PATCH] fix libxc not to hide real errno with EBADF Steven Rostedt
@ 2006-08-04 21:17 ` Chris Wright
  2006-08-05  4:17   ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wright @ 2006-08-04 21:17 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: xen-devel

* Steven Rostedt (srostedt@redhat.com) wrote:
> (this may have white space damage, so I'm attaching the same patch as 
> well. Haven't yet figured out how to do proper inline patches in 
> thunderbird)

This may help:

http://mbligh.org/linuxdocs/Email/Clients/Thunderbird

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

* Re: [PATCH] fix libxc not to hide real errno with EBADF
  2006-08-04 21:17 ` Chris Wright
@ 2006-08-05  4:17   ` Steven Rostedt
  2006-08-05  5:12     ` Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2006-08-05  4:17 UTC (permalink / raw)
  To: Chris Wright; +Cc: xen-devel

Chris Wright wrote:
> * Steven Rostedt (srostedt@redhat.com) wrote:
>   
>> (this may have white space damage, so I'm attaching the same patch as 
>> well. Haven't yet figured out how to do proper inline patches in 
>> thunderbird)
>>     
>
> This may help:
>
> http://mbligh.org/linuxdocs/Email/Clients/Thunderbird
>   
Actually it doesn't :(  I just hate the cut and paste way it makes you 
do it. Where's my insert file!

BTW, I was even in on the thread that was mentioned.  And I may soon put 
evolution on my Red Hat machine ;)

http://lkml.org/lkml/2005/12/27/177

-- Steve

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

* Re: [PATCH] fix libxc not to hide real errno with EBADF
  2006-08-05  4:17   ` Steven Rostedt
@ 2006-08-05  5:12     ` Chris Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wright @ 2006-08-05  5:12 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Chris Wright, xen-devel

* Steven Rostedt (srostedt@redhat.com) wrote:
> Chris Wright wrote:
> >This may help:
> >
> >http://mbligh.org/linuxdocs/Email/Clients/Thunderbird
> >  
> Actually it doesn't :(  I just hate the cut and paste way it makes you 
> do it. Where's my insert file!
> 
> BTW, I was even in on the thread that was mentioned.  And I may soon put 
> evolution on my Red Hat machine ;)
> 
> http://lkml.org/lkml/2005/12/27/177

/me hugs his mutt ;-)

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

end of thread, other threads:[~2006-08-05  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-04 21:13 [PATCH] fix libxc not to hide real errno with EBADF Steven Rostedt
2006-08-04 21:17 ` Chris Wright
2006-08-05  4:17   ` Steven Rostedt
2006-08-05  5:12     ` Chris Wright

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.