MCPcopy Create free account
hub / github.com/coreutils/coreutils / open_next_file

Function open_next_file

src/od.c:1018–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016 message and return false. */
1017
1018static bool
1019open_next_file (void)
1020{
1021 bool ok = true;
1022
1023 do
1024 {
1025 input_filename = *file_list;
1026 if (input_filename == NULL)
1027 return ok;
1028 ++file_list;
1029
1030 if (streq (input_filename, "-"))
1031 {
1032 input_filename = _("standard input");
1033 in_stream = stdin;
1034 have_read_stdin = true;
1035 xset_binary_mode (STDIN_FILENO, O_BINARY);
1036 }
1037 else
1038 {
1039 in_stream = fopen (input_filename, (O_BINARY ? "rb" : "r"));
1040 if (in_stream == NULL)
1041 {
1042 error (0, errno, "%s", quotef (input_filename));
1043 ok = false;
1044 }
1045 }
1046 }
1047 while (in_stream == NULL);
1048
1049 if (0 <= end_offset && !flag_dump_strings)
1050 setvbuf (in_stream, NULL, _IONBF, 0);
1051
1052 return ok;
1053}
1054
1055/* Test whether there have been errors on in_stream, and close it if
1056 it is not standard input. Return false if there has been an error

Callers 4

skipFunction · 0.85
read_charFunction · 0.85
read_blockFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected