sort already have one when it trying to create decompressor, it is
obvious why it is really required in this case, since sort will read
compressed data as plain otherwise.
But sometimes it is really usefull to know whether sort failed to create
compressor or not, since some users may rely on available free space and
compressor.

* src/sort.c (create_temp_file): Add a warning when creating of
compressor failed.
---
There is some old discussion about this
http://osdir.com/ml/bug-coreutils-gnu/2013-07/msg00010.html, but before this
will be fixed(?) we could print a warning on fail at least.
Thanks.

 src/sort.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/sort.c b/src/sort.c
index 49caae5..eb1b1f3 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1133,6 +1133,13 @@ maybe_create_temp (FILE **pfp, bool 
survive_fd_exhaustion)
 
           async_safe_die (errno, "couldn't execute compress program");
         }
+      else
+        {
+          error (0, errno,
+                 _("warning: couldn't create process for %s "
+                   "(try to install overcommit always)"),
+                 compress_program);
+        }
     }
 
   *pfp = fdopen (tempfd, "w");
-- 
2.0.0.rc2


Reply via email to