Skip to content

examples: client: fix reading file from stdin

Stefano babic requested to merge github/fork/jneuhauser/fix-client-stdin into master

Created by: jneuhauser

I suggested that reading a file from stdin is in the client implemented because of the check and special handling for parameter "-" in the main function. My suggestion wasn´t true and open is called with "NULL" as filename instead of using "STDIN_FILENO" (=0) as file descriptor in the function send_file.

This pr fixes this issue.

I prefer to explicit set the file descriptor initially to "STDIN_FILENO" (=0) instead on relying on global variable initialization, as it make this behavior more clear.

Signed-off-by: Johann Neuhauser jneuhauser@dh-electronics.de

Merge request reports