From 201753ddc623a18f4ddd0d9a19391ea0471d4c49 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Feb 2001 01:31:55 +0000 Subject: Fixed file descriptor leak in error processing of print jobs. NT sends "delete on close" to cancel a print job copied from the command line. Deal with this. Merged JohnR's fixes for print job errors. Jeremy. (This used to be commit 2060d74e48d62c99a1689ee02ac435b71918ddf0) --- source3/printing/printfsp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/printing/printfsp.c') diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c index f6ab69fd93..c87fb9754f 100644 --- a/source3/printing/printfsp.c +++ b/source3/printing/printfsp.c @@ -84,6 +84,14 @@ print a file - called on closing the file ****************************************************************************/ void print_fsp_end(files_struct *fsp, BOOL normal_close) { + if (fsp->share_mode == FILE_DELETE_ON_CLOSE) { + /* + * Truncate the job. print_job_end will take + * care of deleting it for us. JRA. + */ + sys_ftruncate(fsp->fd, 0); + } + print_job_end(fsp->print_jobid, normal_close); if (fsp->fsp_name) { -- cgit