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

Function check_and_close

src/od.c:1062–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060 corresponding to the most recent action for IN_STREAM. */
1061
1062static bool
1063check_and_close (int in_errno)
1064{
1065 bool ok = true;
1066
1067 if (in_stream != NULL)
1068 {
1069 if (!ferror (in_stream))
1070 in_errno = 0;
1071 if (streq (file_list[-1], "-"))
1072 clearerr (in_stream);
1073 else if (fclose (in_stream) != 0 && !in_errno)
1074 in_errno = errno;
1075 if (in_errno)
1076 {
1077 error (0, in_errno, "%s", quotef (input_filename));
1078 ok = false;
1079 }
1080
1081 in_stream = NULL;
1082 }
1083
1084 if (ferror (stdout))
1085 {
1086 error (0, 0, _("write error"));
1087 ok = false;
1088 }
1089
1090 return ok;
1091}
1092
1093/* Decode the modern od format string S. Append the decoded
1094 representation to the global array SPEC, reallocating SPEC if

Callers 5

skipFunction · 0.85
read_charFunction · 0.85
read_blockFunction · 0.85
dumpFunction · 0.85
dump_stringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected