Merge lp:~yavor-nikolov/pbzip2/bug-1300876-explicit-close-of-stdout into lp:pbzip2/1.1

Proposed by Yavor Nikolov
Status: Merged
Approved by: Yavor Nikolov
Approved revision: 41
Merged at revision: 39
Proposed branch: lp:~yavor-nikolov/pbzip2/bug-1300876-explicit-close-of-stdout
Merge into: lp:pbzip2/1.1
Diff against target: 45 lines (+16/-2)
2 files modified
ChangeLog (+3/-1)
pbzip2.cpp (+13/-1)
To merge this branch: bzr merge lp:~yavor-nikolov/pbzip2/bug-1300876-explicit-close-of-stdout
Reviewer Review Type Date Requested Status
Yavor Nikolov Approve
Review via email: mp+215307@code.launchpad.net

Description of the change

Fix for #1300876

To post a comment you must log in.
39. By Yavor Nikolov

close redirected stdout to check for errors (bug #1300876)
This is in particular important for NFS/AFS

40. By Yavor Nikolov

Fix an error message on file close

41. By Yavor Nikolov

Updated Changelog for #1300876

Revision history for this message
Yavor Nikolov (yavor-nikolov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2012-07-07 10:53:37 +0000
+++ ChangeLog 2014-04-11 19:55:21 +0000
@@ -1,6 +1,8 @@
1Changes in 1.1.9 (NOT RELEASED YET)1Changes in 1.1.9 (NOT RELEASED YET)
2- spec file refinement for rpm builds thanks to to Ville Skytta2- spec file refinement for rpm builds thanks to to Ville Skytta
3- Makefile refinements for3- Makefile refinements
4- close redirected stdout on finish for better AFS/NFS support (bug #1300876)
5 Thanks to Richard Brittain
4Changes in 1.1.8 (Jun 10, 2012)6Changes in 1.1.8 (Jun 10, 2012)
5- Fix of metadata unpreserved on empty files compress (bug #1011021)7- Fix of metadata unpreserved on empty files compress (bug #1011021)
6Changes in 1.1.7 (Dec 11, 2011)8Changes in 1.1.7 (Dec 11, 2011)
79
=== modified file 'pbzip2.cpp'
--- pbzip2.cpp 2012-06-10 13:25:13 +0000
+++ pbzip2.cpp 2014-04-11 19:55:21 +0000
@@ -2083,7 +2083,7 @@
2083 if (ret == -1)2083 if (ret == -1)
2084 {2084 {
2085 ErrorContext::getInstance()->saveError();2085 ErrorContext::getInstance()->saveError();
2086 handle_error(EF_EXIT, -1, "pbzip2: *ERROR: Could close output file! Aborting...\n");2086 handle_error(EF_EXIT, -1, "pbzip2: *ERROR: Could not close output file! Aborting...\n");
2087 return (NULL); 2087 return (NULL);
2088 }2088 }
2089 }2089 }
@@ -4707,6 +4707,18 @@
4707 fprintf(stderr, "-------------------------------------------\n");4707 fprintf(stderr, "-------------------------------------------\n");
4708 } /* for */4708 } /* for */
47094709
4710 // Explicit close on stdout if we've been writing there, after all input has been processed
4711 if (OutputStdOut == 1)
4712 {
4713 ret = close(STDOUT_FILENO);
4714 if (ret == -1)
4715 {
4716 ErrorContext::getInstance()->saveError();
4717 handle_error(EF_EXIT, 1, "pbzip2: *ERROR: Failed to close STDOUT! Aborting...\n");
4718 exit(1);
4719 }
4720 }
4721
4710 // Terminate signal handler thread sending SIGQUIT signal4722 // Terminate signal handler thread sending SIGQUIT signal
4711 ret = pthread_kill(SignalHandlerThread, SIG_HANDLER_QUIT_SIGNAL);4723 ret = pthread_kill(SignalHandlerThread, SIG_HANDLER_QUIT_SIGNAL);
4712 if (ret != 0)4724 if (ret != 0)

Subscribers

People subscribed via source and target branches