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

Function cmdline_file_new

dpdk/lib/cmdline/cmdline_socket.c:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "cmdline_socket.h"
14
15struct cmdline *
16cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path)
17{
18 int fd;
19
20 /* everything else is checked in cmdline_new() */
21 if (!path)
22 return NULL;
23
24 fd = open(path, O_RDONLY, 0);
25 if (fd < 0) {
26 dprintf("open() failed\n");
27 return NULL;
28 }
29 return cmdline_new(ctx, prompt, fd, -1);
30}
31
32struct cmdline *
33cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt)

Callers 2

test_cmdline_socket_fnsFunction · 0.85
cmdline_read_from_fileFunction · 0.85

Calls 1

cmdline_newFunction · 0.85

Tested by 1

test_cmdline_socket_fnsFunction · 0.68