commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 13/70: libnetfs: properly respond to file_get_translator requests


From: Samuel Thibault
Subject: [hurd] 13/70: libnetfs: properly respond to file_get_translator requests
Date: Mon, 16 Sep 2013 07:41:36 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 82843893f464f258d31ea3a70977e8b82a72bbb5
Author: Justus Winter <address@hidden>
Date:   Tue Jul 16 10:28:01 2013 +0200

    libnetfs: properly respond to file_get_translator requests
    
    Properly respond to file_get_translator requests for nodes with a
    passive translator record.
    
    * libnetfs/file-get-translator.c (netfs_S_file_get_translator): Handle
      passive translator records.
---
 libnetfs/file-get-translator.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libnetfs/file-get-translator.c b/libnetfs/file-get-translator.c
index 59e6102..3e183c1 100644
--- a/libnetfs/file-get-translator.c
+++ b/libnetfs/file-get-translator.c
@@ -109,6 +109,20 @@ netfs_S_file_get_translator (struct protid *user,
       *translen = len;
       err = 0;
     }
+  else if (np->nn_translated & S_IPTRANS)
+    {
+      char *string = NULL;
+      size_t len = 0;
+      err = netfs_get_translator (np, &string, &len);
+      if (!err)
+       {
+         if (len > *translen)
+           *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
+         memmove (*trans, string, len);
+         *translen = len;
+         free (string);
+       }
+    }
   else
     err = EINVAL;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]