OpenCoverage

enable.def

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/enable.def
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12static int dyn_load_builtin (WORD_LIST *, int, char *);-
13-
14-
15-
16static int dyn_unload_builtin (char *);-
17static void delete_builtin (struct builtin *);-
18static int local_dlclose (void *);-
19-
20-
21-
22-
23-
24-
25-
26static void list_some_builtins (int);-
27static int enable_shell_command (char *, int);-
28-
29-
30-
31-
32int-
33enable_builtin (list)-
34 WORD_LIST *list;-
35{-
36 int result, flags;-
37 int opt, filter;-
38-
39 char *filename;-
40-
41-
42 result = 0;-
43 flags = 0;-
44-
45 reset_internal_getopt ();-
46 while ((
(opt = interna...npsf:")) != -1Description
TRUEevaluated 81 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test
opt = internal_getopt (list, "adnpsf:")) != -1
(opt = interna...npsf:")) != -1Description
TRUEevaluated 81 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test
)
45-81
47 {-
48 switch (opt)-
49 {-
50 case
executed 9 times by 1 test: case 'a':
Executed by:
  • Self test
'a':
executed 9 times by 1 test: case 'a':
Executed by:
  • Self test
9
51 flags |= 0x01;-
52 break;
executed 9 times by 1 test: break;
Executed by:
  • Self test
9
53 case
executed 18 times by 1 test: case 'n':
Executed by:
  • Self test
'n':
executed 18 times by 1 test: case 'n':
Executed by:
  • Self test
18
54 flags |= 0x08;-
55 break;
executed 18 times by 1 test: break;
Executed by:
  • Self test
18
56 case
executed 27 times by 1 test: case 'p':
Executed by:
  • Self test
'p':
executed 27 times by 1 test: case 'p':
Executed by:
  • Self test
27
57 flags |= 0x10;-
58 break;
executed 27 times by 1 test: break;
Executed by:
  • Self test
27
59 case
executed 27 times by 1 test: case 's':
Executed by:
  • Self test
's':
executed 27 times by 1 test: case 's':
Executed by:
  • Self test
27
60 flags |= 0x20;-
61 break;
executed 27 times by 1 test: break;
Executed by:
  • Self test
27
62 case
never executed: case 'f':
'f':
never executed: case 'f':
0
63-
64 flags |= 0x04;-
65 filename = list_optarg;-
66 break;
never executed: break;
0
67-
68-
69-
70-
71-
72 case
never executed: case 'd':
'd':
never executed: case 'd':
0
73 flags |= 0x02;-
74 break;
never executed: break;
0
75-
76-
77-
78-
79 case
never executed: case -99:
-99:
never executed: case -99:
builtin_help (); return
never executed: return (258);
(258);
never executed: return (258);
0
80 default
never executed: default:
:
never executed: default:
0
81 builtin_usage ();-
82 return
never executed: return (258);
(258);
never executed: return (258);
0
83 }-
84 }-
85-
86 list = loptend;-
87-
88-
89-
90 if (restricted
restrictedDescription
TRUEnever evaluated
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test
&& (
(flags & (0x04|0x02))Description
TRUEnever evaluated
FALSEnever evaluated
flags & (0x04|0x02))
(flags & (0x04|0x02))Description
TRUEnever evaluated
FALSEnever evaluated
)
0-45
91 {-
92 sh_restricted ((char *)-
93 ((void *)0)-
94 );-
95 return
never executed: return (1);
(1);
never executed: return (1);
0
96 }-
97-
98-
99 if (list == 0
list == 0Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
|| (
(flags & 0x10)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
flags & 0x10)
(flags & 0x10)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
0-27
100 {-
101 filter = (
(flags & 0x01)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
flags & 0x01)
(flags & 0x01)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
? (1 | 2)
9-18
102 : (
(flags & 0x08)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
flags & 0x08)
(flags & 0x08)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 9 times by 1 test
Evaluated by:
  • Self test
? 2 : 1;
9
103-
104 if (flags & 0x20
flags & 0x20Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-27
105 filter |= 4;
executed 27 times by 1 test: filter |= 4;
Executed by:
  • Self test
27
106-
107 list_some_builtins (filter);-
108 }
executed 27 times by 1 test: end of block
Executed by:
  • Self test
27
109-
110 else if (flags & 0x04
flags & 0x04Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
0-18
111 {-
112 filter = (
(flags & 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
flags & 0x08)
(flags & 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
? 2 : 1;
0
113 if (flags & 0x20
flags & 0x20Description
TRUEnever evaluated
FALSEnever evaluated
)
0
114 filter |= 4;
never executed: filter |= 4;
0
115-
116 result = dyn_load_builtin (list, filter, filename);-
117-
118 set_itemlist_dirty (&it_builtins);-
119-
120 }
never executed: end of block
0
121-
122-
123 else if (flags & 0x02
flags & 0x02Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
0-18
124 {-
125 while (list
listDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
126 {-
127 opt = dyn_unload_builtin (list->word->word);-
128 if (opt == 1
opt == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
129 result = 1;
never executed: result = 1;
0
130 list = list->next;-
131 }
never executed: end of block
0
132-
133 set_itemlist_dirty (&it_builtins);-
134-
135 }
never executed: end of block
0
136-
137 else-
138 {-
139 while (list
listDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 18 times by 1 test
Evaluated by:
  • Self test
)
18-19
140 {-
141 opt = enable_shell_command (list->word->word, flags & 0x08);-
142-
143 if (opt == 1
opt == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
)
2-17
144 {-
145 sh_notbuiltin (list->word->word);-
146 result = 1;-
147 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test
2
148 list = list->next;-
149 }
executed 19 times by 1 test: end of block
Executed by:
  • Self test
19
150 }
executed 18 times by 1 test: end of block
Executed by:
  • Self test
18
151 return
executed 45 times by 1 test: return (result);
Executed by:
  • Self test
(result);
executed 45 times by 1 test: return (result);
Executed by:
  • Self test
45
152}-
153-
154-
155-
156static void-
157list_some_builtins (filter)-
158 int filter;-
159{-
160 register int i;-
161-
162 for (i = 0; i < num_shell_builtins
i < num_shell_builtinsDescription
TRUEevaluated 2052 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 27 times by 1 test
Evaluated by:
  • Self test
; i++)
27-2052
163 {-
164 if (shell_builtins[i].function == 0
shell_builtins....function == 0Description
TRUEevaluated 405 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 1647 times by 1 test
Evaluated by:
  • Self test
|| (
(shell_builtin....flags & 0x02)Description
TRUEnever evaluated
FALSEevaluated 1647 times by 1 test
Evaluated by:
  • Self test
shell_builtins[i].flags & 0x02)
(shell_builtin....flags & 0x02)Description
TRUEnever evaluated
FALSEevaluated 1647 times by 1 test
Evaluated by:
  • Self test
)
0-1647
165 continue;
executed 405 times by 1 test: continue;
Executed by:
  • Self test
405
166-
167 if ((
(filter & 4)Description
TRUEevaluated 1647 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
filter & 4)
(filter & 4)Description
TRUEevaluated 1647 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&&
0-1647
168 (
(shell_builtin...s & 0x08) == 0Description
TRUEevaluated 1215 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 432 times by 1 test
Evaluated by:
  • Self test
shell_builtins[i].flags & 0x08) == 0
(shell_builtin...s & 0x08) == 0Description
TRUEevaluated 1215 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 432 times by 1 test
Evaluated by:
  • Self test
)
432-1215
169 continue;
executed 1215 times by 1 test: continue;
Executed by:
  • Self test
1215
170-
171 if ((
(filter & 1)Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 144 times by 1 test
Evaluated by:
  • Self test
filter & 1)
(filter & 1)Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 144 times by 1 test
Evaluated by:
  • Self test
&& (
(shell_builtin....flags & 0x01)Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
shell_builtins[i].flags & 0x01)
(shell_builtin....flags & 0x01)Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
)
0-288
172 printf ("enable %s\n", shell_builtins[i].name);
executed 288 times by 1 test: printf ("enable %s\n", shell_builtins[i].name);
Executed by:
  • Self test
288
173 else if ((
(filter & 2)Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
filter & 2)
(filter & 2)Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • Self test
FALSEnever evaluated
&&
0-144
174 ((
((shell_builti... & 0x01) == 0)Description
TRUEnever evaluated
FALSEevaluated 144 times by 1 test
Evaluated by:
  • Self test
shell_builtins[i].flags & 0x01) == 0)
((shell_builti... & 0x01) == 0)Description
TRUEnever evaluated
FALSEevaluated 144 times by 1 test
Evaluated by:
  • Self test
)
0-144
175 printf ("enable -n %s\n", shell_builtins[i].name);
never executed: printf ("enable -n %s\n", shell_builtins[i].name);
0
176 }
executed 432 times by 1 test: end of block
Executed by:
  • Self test
432
177}
executed 27 times by 1 test: end of block
Executed by:
  • Self test
27
178-
179-
180-
181static int-
182enable_shell_command (name, disable_p)-
183 char *name;-
184 int disable_p;-
185{-
186 struct builtin *b;-
187-
188 b = builtin_address_internal (name, 1);-
189 if (b == 0
b == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test
)
2-17
190 return
executed 2 times by 1 test: return (1);
Executed by:
  • Self test
(1);
executed 2 times by 1 test: return (1);
Executed by:
  • Self test
2
191-
192 if (disable_p
disable_pDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
)
8-9
193 b->flags &= ~0x01;
executed 9 times by 1 test: b->flags &= ~0x01;
Executed by:
  • Self test
9
194-
195 else if (restricted
restrictedDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test
&& ((
((b->flags & 0x01) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
b->flags & 0x01) == 0)
((b->flags & 0x01) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0-8
196 {-
197 sh_restricted ((char *)-
198 ((void *)0)-
199 );-
200 return
never executed: return (1);
(1);
never executed: return (1);
0
201 }-
202-
203 else-
204 b->flags |= 0x01;
executed 8 times by 1 test: b->flags |= 0x01;
Executed by:
  • Self test
8
205-
206-
207 set_itemlist_dirty (&it_enabled);-
208 set_itemlist_dirty (&it_disabled);-
209-
210-
211 return
executed 17 times by 1 test: return (0);
Executed by:
  • Self test
(0);
executed 17 times by 1 test: return (0);
Executed by:
  • Self test
17
212}-
213-
214-
215-
216-
217-
218-
219-
220static int-
221dyn_load_builtin (list, flags, filename)-
222 WORD_LIST *list;-
223 int flags;-
224 char *filename;-
225{-
226 WORD_LIST *l;-
227 void *handle;-
228-
229 int total, size, new, replaced, r;-
230 char *struct_name, *name, *funcname;-
231 sh_load_func_t *loadfunc;-
232 struct builtin **new_builtins, *b, *new_shell_builtins, *old_builtin;-
233 char *loadables_path, *load_path;-
234-
235 if (list == 0
list == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
236 return
never executed: return (1);
(1);
never executed: return (1);
0
237-
238-
239-
240-
241-
242 handle = 0;-
243 if (absolute_program (filename) == 0
absolute_progr...filename) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
244 {-
245 loadables_path = get_string_value ("BASH_LOADABLES_PATH");-
246 if (loadables_path
loadables_pathDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
247 {-
248 load_path = find_in_path (filename, loadables_path, 0x20|0x4);-
249 if (load_path
load_pathDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
250 {-
251-
252-
253-
254 handle = dlopen (load_path, -
255 0x00001-
256 );-
257-
258 sh_xfree((load_path), "./enable.def", 327);-
259 }
never executed: end of block
0
260 }
never executed: end of block
0
261 }
never executed: end of block
0
262-
263-
264 if (handle == 0
handle == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
265-
266-
267-
268 handle = dlopen (filename,
never executed: handle = dlopen (filename, 0x00001 );
0
269 0x00001
never executed: handle = dlopen (filename, 0x00001 );
0
270 );
never executed: handle = dlopen (filename, 0x00001 );
0
271-
272-
273 if (handle == 0
handle == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
274 {-
275 name = printable_filename (filename, 0);-
276 builtin_error (-
277 dcgettext (((void *)0), -
278 "cannot open shared object %s: %s"-
279 , 5)-
280 , name, dlerror ());-
281 if (name != filename
name != filenameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
282 sh_xfree((name), "./enable.def", 345);
never executed: sh_xfree((name), "./enable.def", 345);
0
283 return
never executed: return (1);
(1);
never executed: return (1);
0
284 }-
285-
286 for (new = 0, l = list; l
lDescription
TRUEnever evaluated
FALSEnever evaluated
; l = l->next, new++)
0
287 ;
never executed: ;
0
288 new_builtins = (struct builtin **)sh_xmalloc((new * sizeof (struct builtin *)), "./enable.def", 351);-
289-
290-
291-
292-
293 for (replaced = new = 0; list
listDescription
TRUEnever evaluated
FALSEnever evaluated
; list = list->next)
0
294 {-
295 name = list->word->word;-
296-
297 size = strlen (name);-
298 struct_name = (char *)sh_xmalloc((size + 8), "./enable.def", 361);-
299 strcpy (struct_name, name);-
300 strcpy (struct_name + size, "_struct");-
301-
302 b = (struct builtin *)dlsym (handle, struct_name);-
303 if (b == 0
b == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
304 {-
305 name = printable_filename (filename, 0);-
306 builtin_error (-
307 dcgettext (((void *)0), -
308 "cannot find %s in shared object %s: %s"-
309 , 5)-
310 ,-
311 struct_name, name, dlerror ());-
312 if (name != filename
name != filenameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
313 sh_xfree((name), "./enable.def", 372);
never executed: sh_xfree((name), "./enable.def", 372);
0
314 sh_xfree((struct_name), "./enable.def", 373);-
315 continue;
never executed: continue;
0
316 }-
317-
318 funcname = sh_xrealloc((struct_name), (size + sizeof ("_builtin_load") + 1), "./enable.def", 377);-
319 strcpy (funcname, name);-
320 strcpy (funcname + size, "_builtin_load");-
321-
322 loadfunc = (sh_load_func_t *)dlsym (handle, funcname);-
323 if (loadfunc
loadfuncDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
324 {-
325 r = (*loadfunc) (name);-
326 if (r == 0
r == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
327 {-
328 builtin_error (-
329 dcgettext (((void *)0), -
330 "load function for %s returns failure (%d): not loaded"-
331 , 5)-
332 , name, r);-
333 sh_xfree((funcname), "./enable.def", 388);-
334 continue;
never executed: continue;
0
335 }-
336 }
never executed: end of block
0
337 sh_xfree((funcname), "./enable.def", 392);-
338-
339 b->flags &= ~0x04;-
340 if (flags & 4
flags & 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
341 b->flags |= 0x08;
never executed: b->flags |= 0x08;
0
342 b->handle = handle;-
343-
344 if (old_builtin = builtin_address_internal (name, 1)
old_builtin = ...rnal (name, 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
345 {-
346 replaced++;-
347 __builtin_memcpy (((char *)old_builtin), ((char *)b), (sizeof (struct builtin)));-
348 }
never executed: end of block
0
349 else-
350 new_builtins[new++] = b;
never executed: new_builtins[new++] = b;
0
351 }-
352-
353 if (replaced == 0
replaced == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& new
new == 0Description
TRUEnever evaluated
FALSEnever evaluated
== 0
new == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
354 {-
355 sh_xfree((new_builtins), "./enable.def", 410);-
356 dlclose (handle);-
357 return
never executed: return (1);
(1);
never executed: return (1);
0
358 }-
359-
360 if (new
newDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
361 {-
362 total = num_shell_builtins + new;-
363 size = (total + 1) * sizeof (struct builtin);-
364-
365 new_shell_builtins = (struct builtin *)sh_xmalloc((size), "./enable.def", 420);-
366 __builtin_memcpy (((char *)new_shell_builtins), ((char *)shell_builtins), (num_shell_builtins * sizeof (struct builtin)))-
367 ;-
368 for (replaced = 0; replaced < new
replaced < newDescription
TRUEnever evaluated
FALSEnever evaluated
; replaced++)
0
369 __builtin_memcpy (((char *)&new_shell_builtins[num_shell_builtins + replaced]), ((char *)new_builtins[replaced]), (sizeof (struct builtin)))
never executed: __builtin_memcpy (((char *)&new_shell_builtins[num_shell_builtins + replaced]), ((char *)new_builtins[replaced]), (sizeof (struct builtin))) ;
0
3700
371 ;
never executed: __builtin_memcpy (((char *)&new_shell_builtins[num_shell_builtins + replaced]), ((char *)new_builtins[replaced]), (sizeof (struct builtin))) ;
0
372-
373 new_shell_builtins[total].name = (char *)0;-
374 new_shell_builtins[total].function = (sh_builtin_func_t *)0;-
375 new_shell_builtins[total].flags = 0;-
376-
377 if (shell_builtins != static_shell_builtins
shell_builtins...shell_builtinsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
378 sh_xfree((shell_builtins), "./enable.def", 433);
never executed: sh_xfree((shell_builtins), "./enable.def", 433);
0
379-
380 shell_builtins = new_shell_builtins;-
381 num_shell_builtins = total;-
382 initialize_shell_builtins ();-
383 }
never executed: end of block
0
384-
385 sh_xfree((new_builtins), "./enable.def", 440);-
386 return
never executed: return (0);
(0);
never executed: return (0);
0
387}-
388-
389-
390-
391static void-
392delete_builtin (b)-
393 struct builtin *b;-
394{-
395 int ind, size;-
396 struct builtin *new_shell_builtins;-
397-
398-
399-
400 ind = b - shell_builtins;-
401-
402-
403-
404 size = num_shell_builtins * sizeof (struct builtin);-
405 new_shell_builtins = (struct builtin *)sh_xmalloc((size), "./enable.def", 460);-
406-
407-
408 if (ind
indDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
409 __builtin_memcpy (((char *)new_shell_builtins), ((char *)shell_builtins), (ind * sizeof (struct builtin)))
never executed: __builtin_memcpy (((char *)new_shell_builtins), ((char *)shell_builtins), (ind * sizeof (struct builtin))) ;
0
410 ;
never executed: __builtin_memcpy (((char *)new_shell_builtins), ((char *)shell_builtins), (ind * sizeof (struct builtin))) ;
0
411-
412-
413 __builtin_memcpy (((char *)(&new_shell_builtins[ind])), ((char *)(&shell_builtins[ind+1])), ((num_shell_builtins - ind) * sizeof (struct builtin)))-
414-
415 ;-
416-
417 if (shell_builtins != static_shell_builtins
shell_builtins...shell_builtinsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
418 sh_xfree((shell_builtins), "./enable.def", 473);
never executed: sh_xfree((shell_builtins), "./enable.def", 473);
0
419-
420-
421 num_shell_builtins--;-
422 shell_builtins = new_shell_builtins;-
423}
never executed: end of block
0
424-
425-
426-
427static int-
428local_dlclose (handle)-
429 void *handle;-
430{-
431-
432 return
never executed: return (dlclose (handle));
(dlclose (handle));
never executed: return (dlclose (handle));
0
433-
434-
435-
436-
437}-
438-
439static int-
440dyn_unload_builtin (name)-
441 char *name;-
442{-
443 struct builtin *b;-
444 void *handle;-
445 char *funcname;-
446 sh_unload_func_t *unloadfunc;-
447 int ref, i, size;-
448-
449 b = builtin_address_internal (name, 1);-
450 if (b == 0
b == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
451 {-
452 sh_notbuiltin (name);-
453 return
never executed: return (1);
(1);
never executed: return (1);
0
454 }-
455 if (b->flags & 0x04
b->flags & 0x04Description
TRUEnever evaluated
FALSEnever evaluated
)
0
456 {-
457 builtin_error (-
458 dcgettext (((void *)0), -
459 "%s: not dynamically loaded"-
460 , 5)-
461 , name);-
462 return
never executed: return (1);
(1);
never executed: return (1);
0
463 }-
464-
465 handle = (void *)b->handle;-
466 for (ref = i = 0; i < num_shell_builtins
i < num_shell_builtinsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
467 {-
468 if (shell_builtins[i].handle == b->handle
shell_builtins...e == b->handleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
469 ref++;
never executed: ref++;
0
470 }
never executed: end of block
0
471-
472-
473 size = strlen (name);-
474 funcname = sh_xmalloc((size + sizeof ("_builtin_unload") + 1), "./enable.def", 525);-
475 strcpy (funcname, name);-
476 strcpy (funcname + size, "_builtin_unload");-
477-
478 unloadfunc = (sh_unload_func_t *)dlsym (handle, funcname);-
479 if (unloadfunc
unloadfuncDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
480 (*
never executed: (*unloadfunc) (name);
unloadfunc) (name);
never executed: (*unloadfunc) (name);
0
481 sh_xfree((funcname), "./enable.def", 532);-
482-
483-
484-
485 if (ref == 1
ref == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& local_dlclose (handle) != 0
local_dlclose (handle) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
486 {-
487 builtin_error (-
488 dcgettext (((void *)0), -
489 "%s: cannot delete: %s"-
490 , 5)-
491 , name, dlerror ());-
492 return
never executed: return (1);
(1);
never executed: return (1);
0
493 }-
494-
495-
496 delete_builtin (b);-
497-
498 return
never executed: return (0);
(0);
never executed: return (0);
0
499}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2