On 05/09/2011 04:37 PM, Eric Blake wrote:
> open/access/close is cheaper than open/stat/stat/close.
> 
> * lib/openat-proc.c (openat_proc_name): Simplify.
> * modules/openat (Depends-on): Drop same-inode.
> Reported by Bastien ROUCARIES.
> 
> Signed-off-by: Eric Blake <ebl...@redhat.com>
> ---
> 
> I'm pushing this.

Oh, and while touching this, I'm squashing in:

diff --git c/lib/openat-proc.c w/lib/openat-proc.c
index d4659ff..5711896 100644
--- c/lib/openat-proc.c
+++ w/lib/openat-proc.c
@@ -74,7 +74,8 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int
fd, char const *file)
          problem is exhibited on code that built on Solaris 8 and
          running on Solaris 10.  */

-      int proc_self_fd = open ("/proc/self/fd", O_SEARCH);
+      int proc_self_fd = open ("/proc/self/fd",
+                               O_SEARCH | O_DIRECTORY | O_NOCTTY |
O_NONBLOCK);
       if (proc_self_fd < 0)
         proc_status = -1;
       else


-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to