MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / readArgFromStdin

Function readArgFromStdin

src/redis-cli.c:1678–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1676}
1677
1678static sds readArgFromStdin(void) {
1679 char buf[1024];
1680 sds arg = sdsempty();
1681
1682 while(1) {
1683 int nread = read(fileno(stdin),buf,1024);
1684
1685 if (nread == 0) break;
1686 else if (nread == -1) {
1687 perror("Reading from standard input");
1688 exit(1);
1689 }
1690 arg = sdscatlen(arg,buf,nread);
1691 }
1692 return arg;
1693}
1694
1695static void usage(void) {
1696 sds version = cliVersion();

Callers 1

noninteractiveFunction · 0.85

Calls 2

sdsemptyFunction · 0.85
sdscatlenFunction · 0.85

Tested by

no test coverage detected