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

Function main

src/chmod.c:477–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475 of 'struct mode_change' and apply that to each file argument. */
476
477int
478main (int argc, char **argv)
479{
480 char *mode = NULL;
481 idx_t mode_len = 0;
482 idx_t mode_alloc = 0;
483 bool ok;
484 bool preserve_root = false;
485 char const *reference_file = NULL;
486 int c;
487 int bit_flags = FTS_COMFOLLOW | FTS_PHYSICAL;
488
489 initialize_main (&argc, &argv);
490 set_program_name (argv[0]);
491 setlocale (LC_ALL, "");
492 bindtextdomain (PACKAGE, LOCALEDIR);
493 textdomain (PACKAGE);
494
495 atexit (close_stdout);
496
497 while ((c = getopt_long (argc, argv,
498 ("HLPRcfhvr::w::x::X::s::t::u::g::o::a::,::+::=::"
499 "0::1::2::3::4::5::6::7::"),
500 long_options, NULL))
501 != -1)
502 {
503 switch (c)
504 {
505
506 case 'H': /* Traverse command-line symlinks-to-directories. */
507 bit_flags = FTS_COMFOLLOW | FTS_PHYSICAL;
508 break;
509
510 case 'L': /* Traverse all symlinks-to-directories. */
511 bit_flags = FTS_LOGICAL;
512 break;
513
514 case 'P': /* Traverse no symlinks-to-directories. */
515 bit_flags = FTS_PHYSICAL;
516 break;
517
518 case 'h': /* --no-dereference: affect symlinks */
519 dereference = 0;
520 break;
521
522 case DEREFERENCE_OPTION: /* --dereference: affect the referent
523 of each symlink */
524 dereference = 1;
525 break;
526
527 case 'r':
528 case 'w':
529 case 'x':
530 case 'X':
531 case 's':
532 case 't':
533 case 'u':
534 case 'g':

Callers

nothing calls this directly

Calls 3

get_root_dev_inoFunction · 0.85
usageFunction · 0.70
process_filesFunction · 0.70

Tested by

no test coverage detected