bug-hurd
[Top][All Lists]
Advanced

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

[address@hidden: Re: [PATCH] Trivial fix on an argument in ftpfs]


From: Alfred M. Szmidt
Subject: [address@hidden: Re: [PATCH] Trivial fix on an argument in ftpfs]
Date: Thu, 04 Aug 2005 17:09:13 +0200

Ping...
------- Start of forwarded message -------
From: "Alfred M\. Szmidt" <ams@gnu.org>
To: bug-hurd@gnu.org
Date: Sat, 30 Jul 2005 14:33:07 +0200
Subject: Re: [PATCH] Trivial fix on an argument in ftpfs

Looks ok, I haven't tested it, but Samuel told me that he had.

Roland, OK to commit?

ftpfs/ChangeLog
2005-07-30  Samuel Thibault  <samuel.thibault@ens-lyon.org>

        * node.c (ftpfs_create_node): Check the result from
        hurd_ihash_add ().  Add E to the hash table instead of NEW.

libihash/ChangeLog
2005-07-30  Samuel Thibault  <samuel.thibault@ens-lyon.org>

        * ihash.c (add_one): Cast VALUE with (hurd_ihash_locp_t *)
        instead of (hurd_ihash_locp_t).

Index: libihash/ihash.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libihash/ihash.c,v
retrieving revision 1.9
diff -u -u -p -r1.9 ihash.c
- --- libihash/ihash.c  2 Apr 2004 17:01:03 -0000       1.9
+++ libihash/ihash.c    30 Jul 2005 01:38:27 -0000
@@ -329,7 +329,7 @@ add_one (hurd_ihash_t ht, hurd_ihash_key
       ht->items[first_free].key = key;
 
       if (ht->locp_offset != HURD_IHASH_NO_LOCP)
- -     *((hurd_ihash_locp_t) (((char *) value) + ht->locp_offset))
+       *((hurd_ihash_locp_t *) (((char *) value) + ht->locp_offset))
          = &ht->items[first_free].value;
 
       return 1;

Index: ftpfs/node.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ftpfs/node.c,v
retrieving revision 1.2
diff -u -p -r1.2 node.c
- --- ftpfs/node.c      1 Mar 2004 09:58:44 -0000       1.2
+++ ftpfs/node.c        30 Jul 2005 01:38:07 -0000
@@ -39,6 +39,7 @@ ftpfs_create_node (struct ftpfs_dir_entr
 {
   struct node *new;
   struct netnode *nn = malloc (sizeof (struct netnode));
+  error_t err;
 
   if (! nn)
     return ENOMEM;
@@ -61,9 +62,16 @@ ftpfs_create_node (struct ftpfs_dir_entr
                ftpfs_maptime);
 
   spin_lock (&nn->fs->inode_mappings_lock);
- -  hurd_ihash_add (&nn->fs->inode_mappings, e->stat.st_ino, new);
+  err = hurd_ihash_add (&nn->fs->inode_mappings, e->stat.st_ino, e);
   spin_unlock (&nn->fs->inode_mappings_lock);
 
+  if (err)
+    {
+      free (nn);
+      free (new);
+      return err;
+    }
+
   e->node = new;
   *node = new;


_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd
------- End of forwarded message -------




reply via email to

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