| 415549f1 | 03-Feb-2023 |
Stephen Hemminger <stephen@networkplumber.org> |
cmdline: handle EOF as quit
If end of file is reached on input, then cmdline_poll() will return 1 (ie file has something); and then the cmdline_in() call to read will return 0. With the existing cod
cmdline: handle EOF as quit
If end of file is reached on input, then cmdline_poll() will return 1 (ie file has something); and then the cmdline_in() call to read will return 0. With the existing code, caller has no way to tell that end of file has been reached and will retry forever.
A good way to handle this is to make end of file equivalent to the quit command. Since no more input is possible at that point.
Fixes: 067855e651d6 ("cmdline: add polling mode") Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|
| 6ad06203 | 18-Oct-2021 |
Zhihong Peng <zhihongx.peng@intel.com> |
cmdline: free on exit
Malloc cl in the cmdline_stdin_new function, so release in the cmdline_stdin_exit function is logical, so that cl will not be released alone.
Fixes: af75078fece3 ("first publi
cmdline: free on exit
Malloc cl in the cmdline_stdin_new function, so release in the cmdline_stdin_exit function is logical, so that cl will not be released alone.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com> Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Zhihong Peng <zhihongx.peng@intel.com>
show more ...
|
| f8f8dc28 | 07-Oct-2021 |
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> |
cmdline: make struct rdline opaque
Hide struct rdline definition and some RDLINE_* constants in order to be able to change internal buffer sizes transparently to the user. Add new functions:
* rdli
cmdline: make struct rdline opaque
Hide struct rdline definition and some RDLINE_* constants in order to be able to change internal buffer sizes transparently to the user. Add new functions:
* rdline_new(): allocate and initialize struct rdline. This function replaces rdline_init() and takes an extra parameter: opaque user data for the callbacks. * rdline_free(): deallocate struct rdline. * rdline_get_history_buffer_size(): for use in tests. * rdline_get_opaque(): to obtain user data in callback functions.
Remove rdline_init() function from library headers and export list, because using it requires the knowledge of sizeof(struct rdline).
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
show more ...
|