summaryrefslogtreecommitdiff
path: root/debian/patches/xattr0003-Small-fixes.patch
blob: 77a5e43350bca765858d7823130adb2a6fcfce96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 19f7a0af88ebd92223c89c7134d5ba15b781c8d9 Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Thu, 14 Jul 2016 23:53:28 +0200
Subject: [PATCH hurd 3/6] Small fixes

---
 ext2fs/inode.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/ext2fs/inode.c b/ext2fs/inode.c
index 175bc26..fd28295 100644
--- a/ext2fs/inode.c
+++ b/ext2fs/inode.c
@@ -578,20 +578,19 @@ diskfs_set_translator (struct node *np, const char *name, unsigned namelen,
     }
 
   /* Use xattr to store translator record, with key "gnu.translator" */
-  err = ext2_get_xattr(np, "gnu.translator", NULL, &len);
-  if (err && err != ENODATA)
-    return err;
-
-  if (namelen && err == ENODATA)
+  if (namelen)
     {
-      err = ext2_set_xattr(np, "gnu.translator", name, namelen, XATTR_CREATE);
+      err = ext2_set_xattr (np, "gnu.translator", name, namelen, 0);
 
       np->dn_stat.st_mode |= S_IPTRANS;
       np->dn_set_ctime = 1;
     }
-  else if (!namelen && !err)
+  else
     {
-      err = ext2_set_xattr(np, "gnu.translator", NULL, 0, 0);
+      err = ext2_set_xattr (np, "gnu.translator", NULL, 0, 0);
+
+      np->dn_stat.st_mode &= ~S_IPTRANS;
+      np->dn_set_ctime = 1;
     }
 
   diskfs_end_catch_exception ();
-- 
2.8.1