Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/link.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | - | |||||||
9 | static struct option const long_options[] = | - | ||||||
10 | { | - | ||||||
11 | { | - | ||||||
12 | ((void *)0) | - | ||||||
13 | , 0, | - | ||||||
14 | ((void *)0) | - | ||||||
15 | , 0} | - | ||||||
16 | }; | - | ||||||
17 | - | |||||||
18 | void | - | ||||||
19 | usage (int status) | - | ||||||
20 | { | - | ||||||
21 | if (status !=
| 3 | ||||||
22 | 0
| 3 | ||||||
23 | ) | - | ||||||
24 | do { fprintf ( | - | ||||||
25 | stderr | - | ||||||
26 | , | - | ||||||
27 | dcgettext (((void *)0), | - | ||||||
28 | "Try '%s --help' for more information.\n" | - | ||||||
29 | , 5) | - | ||||||
30 | , program_name); } executed 3 times by 1 test: while (0);end of block Executed by:
| 3 | ||||||
31 | else | - | ||||||
32 | { | - | ||||||
33 | printf ( | - | ||||||
34 | dcgettext (((void *)0), | - | ||||||
35 | "Usage: %s FILE1 FILE2\n or: %s OPTION\n" | - | ||||||
36 | , 5) | - | ||||||
37 | - | |||||||
38 | - | |||||||
39 | , program_name, program_name); | - | ||||||
40 | fputs_unlocked ( | - | ||||||
41 | dcgettext (((void *)0), | - | ||||||
42 | "Call the link function to create a link named FILE2 to an existing FILE1.\n\n" | - | ||||||
43 | , 5) | - | ||||||
44 | , | - | ||||||
45 | stdout | - | ||||||
46 | ) | - | ||||||
47 | - | |||||||
48 | ; | - | ||||||
49 | fputs_unlocked ( | - | ||||||
50 | dcgettext (((void *)0), | - | ||||||
51 | " --help display this help and exit\n" | - | ||||||
52 | , 5) | - | ||||||
53 | , | - | ||||||
54 | stdout | - | ||||||
55 | ); | - | ||||||
56 | fputs_unlocked ( | - | ||||||
57 | dcgettext (((void *)0), | - | ||||||
58 | " --version output version information and exit\n" | - | ||||||
59 | , 5) | - | ||||||
60 | , | - | ||||||
61 | stdout | - | ||||||
62 | ); | - | ||||||
63 | emit_ancillary_info ("link"); | - | ||||||
64 | } executed 3 times by 1 test: end of block Executed by:
| 3 | ||||||
65 | exit (status); executed 6 times by 1 test: exit (status); Executed by:
| 6 | ||||||
66 | } | - | ||||||
67 | - | |||||||
68 | int | - | ||||||
69 | main (int argc, char **argv) | - | ||||||
70 | { | - | ||||||
71 | ; | - | ||||||
72 | set_program_name (argv[0]); | - | ||||||
73 | setlocale ( | - | ||||||
74 | 6 | - | ||||||
75 | , ""); | - | ||||||
76 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||
77 | textdomain ("coreutils"); | - | ||||||
78 | - | |||||||
79 | atexit (close_stdout); | - | ||||||
80 | - | |||||||
81 | parse_long_options (argc, argv, "link", "GNU coreutils", Version, | - | ||||||
82 | usage, ("Michael Stone"), (char const *) | - | ||||||
83 | ((void *)0) | - | ||||||
84 | ); | - | ||||||
85 | if (getopt_long (argc, argv, "", long_options,
| 1-3 | ||||||
86 | ((void *)0)
| 1-3 | ||||||
87 | ) != -1
| 1-3 | ||||||
88 | usage ( executed 3 times by 1 test: usage ( 1 ); Executed by:
| 3 | ||||||
89 | 1 executed 3 times by 1 test: usage ( 1 ); Executed by:
| 3 | ||||||
90 | ); executed 3 times by 1 test: usage ( 1 ); Executed by:
| 3 | ||||||
91 | - | |||||||
92 | if (argc < optind + 2
| 0-1 | ||||||
93 | { | - | ||||||
94 | if (argc < optind + 1
| 0 | ||||||
95 | error (0, 0, never executed: error (0, 0, dcgettext (((void *)0), "missing operand" , 5) ); | 0 | ||||||
96 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "missing operand" , 5) ); | 0 | ||||||
97 | "missing operand" never executed: error (0, 0, dcgettext (((void *)0), "missing operand" , 5) ); | 0 | ||||||
98 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "missing operand" , 5) ); | 0 | ||||||
99 | ); never executed: error (0, 0, dcgettext (((void *)0), "missing operand" , 5) ); | 0 | ||||||
100 | else | - | ||||||
101 | error (0, 0, never executed: error (0, 0, dcgettext (((void *)0), "missing operand after %s" , 5) , quote (argv[optind])); | 0 | ||||||
102 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "missing operand after %s" , 5) , quote (argv[optind])); | 0 | ||||||
103 | "missing operand after %s" never executed: error (0, 0, dcgettext (((void *)0), "missing operand after %s" , 5) , quote (argv[optind])); | 0 | ||||||
104 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "missing operand after %s" , 5) , quote (argv[optind])); | 0 | ||||||
105 | , quote (argv[optind])); never executed: error (0, 0, dcgettext (((void *)0), "missing operand after %s" , 5) , quote (argv[optind])); | 0 | ||||||
106 | usage ( | - | ||||||
107 | 1 | - | ||||||
108 | ); | - | ||||||
109 | } never executed: end of block | 0 | ||||||
110 | - | |||||||
111 | if (optind + 2 < argc
| 0-1 | ||||||
112 | { | - | ||||||
113 | error (0, 0, | - | ||||||
114 | dcgettext (((void *)0), | - | ||||||
115 | "extra operand %s" | - | ||||||
116 | , 5) | - | ||||||
117 | , quote (argv[optind + 2])); | - | ||||||
118 | usage ( | - | ||||||
119 | 1 | - | ||||||
120 | ); | - | ||||||
121 | } never executed: end of block | 0 | ||||||
122 | - | |||||||
123 | if (link (argv[optind], argv[optind + 1]) != 0
| 0-1 | ||||||
124 | (( never executed: !!sizeof (struct { _Static_assert (((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
125 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
126 | , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), assume (false))" ")"); int _gl_dummy; })) ? ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
127 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
128 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
129 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
130 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
131 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
132 | "cannot create link %s to %s" never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
133 | , 5) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
134 | , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
135 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
136 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
137 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
138 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
139 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
140 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
141 | dcgettext (((void *)0), never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
142 | "cannot create link %s to %s" never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
143 | , 5) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
144 | , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
145 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
146 | ) ? (void) 0 : __builtin_unreachable ())))) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
147 | ; never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"cannot create link %s to %s\", 5), quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style...ettext (((void *)0), "cannot create link %s to %s" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, argv[optind + 1]), quotearg_n_style (1, shell_escape_always_quoting_style, argv[optind])), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ; | 0 | ||||||
148 | - | |||||||
149 | return executed 1 time by 1 test: return 0 ; Executed by:
executed 1 time by 1 test: return 0 ; Executed by:
| 1 | ||||||
150 | 0 executed 1 time by 1 test: return 0 ; Executed by:
| 1 | ||||||
151 | ; executed 1 time by 1 test: return 0 ; Executed by:
| 1 | ||||||
152 | } | - | ||||||
Switch to Source code | Preprocessed file |