OpenCoverage

hostid.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/hostid.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static struct option const long_options[] =-
9{-
10 {-
11 ((void *)0)-
12 , 0, -
13 ((void *)0)-
14 , 0}-
15};-
16-
17void-
18usage (int status)-
19{-
20 if (status !=
status != 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • hostid
FALSEevaluated 3 times by 1 test
Evaluated by:
  • hostid
3
21 0
status != 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • hostid
FALSEevaluated 3 times by 1 test
Evaluated by:
  • hostid
3
22 )-
23 do { fprintf (-
24 stderr-
25 , -
26 dcgettext (((void *)0), -
27 "Try '%s --help' for more information.\n"-
28 , 5)-
29 , program_name); }
executed 3 times by 1 test: end of block
Executed by:
  • hostid
while (0);
3
30 else-
31 {-
32 printf (-
33 dcgettext (((void *)0), -
34 "Usage: %s [OPTION]\nPrint the numeric identifier (in hexadecimal) for the current host.\n\n"-
35 , 5)-
36-
37-
38-
39 -
40 , program_name);-
41 fputs_unlocked (-
42 dcgettext (((void *)0), -
43 " --help display this help and exit\n"-
44 , 5)-
45 ,-
46 stdout-
47 );-
48 fputs_unlocked (-
49 dcgettext (((void *)0), -
50 " --version output version information and exit\n"-
51 , 5)-
52 ,-
53 stdout-
54 );-
55 emit_ancillary_info ("hostid");-
56 }
executed 3 times by 1 test: end of block
Executed by:
  • hostid
3
57 exit (status);
executed 6 times by 1 test: exit (status);
Executed by:
  • hostid
6
58}-
59-
60int-
61main (int argc, char **argv)-
62{-
63 unsigned int id;-
64-
65 ;-
66 set_program_name (argv[0]);-
67 setlocale (-
68 6-
69 , "");-
70 bindtextdomain ("coreutils", "/usr/local/share/locale");-
71 textdomain ("coreutils");-
72-
73 atexit (close_stdout);-
74-
75 parse_long_options (argc, argv, "hostid", "GNU coreutils", Version,-
76 usage, ("Jim Meyering"), (char const *) -
77 ((void *)0)-
78 );-
79 if (getopt_long (argc, argv, "", long_options,
getopt_long (a...d *)0) ) != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • hostid
FALSEevaluated 1 time by 1 test
Evaluated by:
  • hostid
1-3
80 ((void *)0)
getopt_long (a...d *)0) ) != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • hostid
FALSEevaluated 1 time by 1 test
Evaluated by:
  • hostid
1-3
81 ) != -1
getopt_long (a...d *)0) ) != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • hostid
FALSEevaluated 1 time by 1 test
Evaluated by:
  • hostid
)
1-3
82 usage (
executed 3 times by 1 test: usage ( 1 );
Executed by:
  • hostid
3
83 1
executed 3 times by 1 test: usage ( 1 );
Executed by:
  • hostid
3
84 );
executed 3 times by 1 test: usage ( 1 );
Executed by:
  • hostid
3
85-
86 if (optind < argc
optind < argcDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • hostid
)
0-1
87 {-
88 error (0, 0, -
89 dcgettext (((void *)0), -
90 "extra operand %s"-
91 , 5)-
92 , quote (argv[optind]));-
93 usage (-
94 1-
95 );-
96 }
never executed: end of block
0
97-
98 id = gethostid ();-
99-
100-
101-
102-
103 id &= 0xffffffff;-
104-
105 printf ("%08x\n", id);-
106-
107 return
executed 1 time by 1 test: return 0 ;
Executed by:
  • hostid
executed 1 time by 1 test: return 0 ;
Executed by:
  • hostid
1
108 0
executed 1 time by 1 test: return 0 ;
Executed by:
  • hostid
1
109 ;
executed 1 time by 1 test: return 0 ;
Executed by:
  • hostid
1
110}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2