Project/Real_code/gnu/coreutils-5.0/src/du.c
static int
hash_ins (ino_t ino, dev_t dev)
{
  struct entry *ent;
  struct entry *ent_from_table;

  ent = (struct entry *) xmalloc (sizeof *ent);
  ent->st_ino = ino;
  ent->st_dev = dev;

  ent_from_table = hash_insert (htab, ent);
  if (ent_from_table == NULL)
    {
      /* Insertion failed due to lack of memory.  */
      xalloc_die ();
    }

  if (ent_from_table == ent)
    {
      /* Insertion succeeded.  */
      return 0;
    }

  /* That pair is already in the table, so ENT was not inserted.  Free it.  */
  free (ent);

  return 1;
}
/* Try to insert the INO/DEV pair into the global table, HTAB.
   If the pair is successfully inserted, return zero.
   Upon failed memory allocation exit nonzero.
   If the pair is already in the table, return nonzero.  */
Try to insert the INO/DEV pair into the global table, HTAB.
If the pair is successfully inserted, return zero.
Upon failed memory allocation exit nonzero.
If the pair is already in the table, return nonzero.
Try to insert the INO / DEV pair into the global table HTAB . If the pair is successfully inserted return zero . Upon failed memory allocation exit nonzero . If the pair is already in the table return nonzero .
static int
hash_ins (ino_t ino, dev_t dev)
{
  struct entry *ent;
  struct entry *ent_from_table;
  ent = (struct entry *) xmalloc (sizeof *ent);
  ent->st_ino = ino;
  ent->st_dev = dev;
  ent_from_table = hash_insert (htab, ent);
  if (ent_from_table == NULL)
    {
      xalloc_die ();
    }
  if (ent_from_table == ent)
    {
      return 0;
    }
  free (ent);
  return 1;
}
static int hash_ins ( ino_t ino , dev_t dev ) { struct entry * ent ; struct entry * ent_from_table ; ent = ( struct entry * ) xmalloc ( sizeof * ent ) ; ent -> st_ino = ino ; ent -> st_dev = dev ; ent_from_table = hash_insert ( htab , ent ) ; if ( ent_from_table == NULL ) { xalloc_die ( ) ; } if ( ent_from_table == ent ) { return 0 ; } free ( ent ) ; return 1 ; }
Try to insert the INO/DEV pair into the global table, HTAB.
Try to insert the INO / DEV pair into the global table HTAB .
/* Insertion failed due to lack of memory.  */ /* Insertion succeeded.  */ /* That pair is already in the table, so ENT was not inserted.  Free it.  */