MCPcopy Create free account
hub / github.com/coreutils/coreutils / visit_dir

Function visit_dir

src/ls.c:1449–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1447 entry in the table. */
1448
1449static bool
1450visit_dir (dev_t dev, ino_t ino)
1451{
1452 struct dev_ino *ent;
1453 struct dev_ino *ent_from_table;
1454 bool found_match;
1455
1456 ent = xmalloc (sizeof *ent);
1457 ent->st_ino = ino;
1458 ent->st_dev = dev;
1459
1460 /* Attempt to insert this entry into the table. */
1461 ent_from_table = hash_insert (active_dir_set, ent);
1462
1463 if (ent_from_table == NULL)
1464 {
1465 /* Insertion failed due to lack of memory. */
1466 xalloc_die ();
1467 }
1468
1469 found_match = (ent_from_table != ent);
1470
1471 if (found_match)
1472 {
1473 /* ent was not inserted, so free it. */
1474 free (ent);
1475 }
1476
1477 return found_match;
1478}
1479
1480static void
1481free_pending_ent (struct pending *p)

Callers 1

print_dirFunction · 0.85

Calls 1

xalloc_dieFunction · 0.85

Tested by

no test coverage detected