OpenCoverage

fd-reopen.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gl/lib/fd-reopen.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8int-
9fd_reopen (int desired_fd, char const *file, int flags, mode_t mode)-
10{-
11 int fd = open (file, flags, mode);-
12-
13 if (fd == desired_fd
fd == desired_fdDescription
TRUEevaluated 219539 times by 1 test
Evaluated by:
  • touch
FALSEevaluated 4823 times by 4 tests
Evaluated by:
  • csplit
  • dd
  • split
  • touch
|| fd < 0
fd < 0Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • dd
  • touch
FALSEevaluated 4809 times by 4 tests
Evaluated by:
  • csplit
  • dd
  • split
  • touch
)
14-219539
14 return
executed 219553 times by 2 tests: return fd;
Executed by:
  • dd
  • touch
fd;
executed 219553 times by 2 tests: return fd;
Executed by:
  • dd
  • touch
219553
15 else-
16 {-
17 int fd2 = dup2 (fd, desired_fd);-
18 int saved_errno = -
19 (*__errno_location ())-
20 ;-
21 close (fd);-
22 -
23 (*__errno_location ()) -
24 = saved_errno;-
25 return
executed 4809 times by 4 tests: return fd2;
Executed by:
  • csplit
  • dd
  • split
  • touch
fd2;
executed 4809 times by 4 tests: return fd2;
Executed by:
  • csplit
  • dd
  • split
  • touch
4809
26 }-
27}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2