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

Function cleanup

src/dd.c:923–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921static int synchronize_output (void);
922
923static void
924cleanup (void)
925{
926 if (!interrupt_signal)
927 {
928 int sync_status = synchronize_output ();
929 if (sync_status)
930 exit (sync_status);
931 }
932
933 if (iclose (STDIN_FILENO) != 0)
934 error (EXIT_FAILURE, errno, _("closing input file %s"),
935 quoteaf (input_file));
936
937 /* Don't remove this call to close, even though close_stdout
938 closes standard output. This close is necessary when cleanup
939 is called as a consequence of signal handling. */
940 if (iclose (STDOUT_FILENO) != 0)
941 error (EXIT_FAILURE, errno,
942 _("closing output file %s"), quoteaf (output_file));
943}
944
945/* Process any pending signals. If signals are caught, this function
946 should be called periodically. Ideally there should never be an

Callers 2

process_signalsFunction · 0.70
finish_upFunction · 0.70

Calls 2

synchronize_outputFunction · 0.85
icloseFunction · 0.85

Tested by

no test coverage detected