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

Function readArgFromStdin

app/redis-6.2.6/src/redis-cli.c:1867–1882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1865}
1866
1867static sds readArgFromStdin(void) {
1868 char buf[1024];
1869 sds arg = sdsempty();
1870
1871 while(1) {
1872 int nread = read(fileno(stdin),buf,1024);
1873
1874 if (nread == 0) break;
1875 else if (nread == -1) {
1876 perror("Reading from standard input");
1877 exit(1);
1878 }
1879 arg = sdscatlen(arg,buf,nread);
1880 }
1881 return arg;
1882}
1883
1884static void usage(void) {
1885 sds version = cliVersion();

Callers 1

noninteractiveFunction · 0.85

Calls 3

sdsemptyFunction · 0.85
sdscatlenFunction · 0.85
readFunction · 0.70

Tested by

no test coverage detected