MCPcopy Create free account
hub / github.com/F-Stack/f-stack / auth_cat

Function auth_cat

tools/libutil/login_auth.c:95–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 */
94
95int
96auth_cat(const char *file)
97{
98 int fd, count;
99 char buf[BUFSIZ];
100
101 if ((fd = open(file, O_RDONLY | O_CLOEXEC)) < 0)
102 return 0;
103 while ((count = read(fd, buf, sizeof(buf))) > 0)
104 (void)write(fileno(stdout), buf, count);
105 close(fd);
106 sleep(5); /* wait an arbitrary time to drain */
107 return 1;
108}

Callers 1

auth_checknologinFunction · 0.85

Calls 3

readFunction · 0.50
writeFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected