--- /dev/null
+Index: /trunk/logrotate.c\r
+===================================================================\r
+--- /trunk/logrotate.c (revision 454)\r
++++ /trunk/logrotate.c (revision 455)\r
+@@ -523,4 +523,7 @@\r
+ int i;\r
+ int status;\r
++ int compressPipe[2];\r
++ char buff[4092];\r
++ int error_printed = 0;\r
+ \r
+ message(MESS_DEBUG, "compressing log with: %s\n", log->compress_prog);\r
+@@ -567,4 +570,12 @@\r
+ }\r
+ \r
++ if (pipe(compressPipe) < 0) {\r
++ message(MESS_ERROR, "error opening pipe for compress: %s",\r
++ strerror(errno));\r
++ close(inFile);\r
++ close(outFile);\r
++ return 1;\r
++ }\r
++\r
+ if (!FORK_OR_VFORK()) {\r
+ dup2(inFile, 0);\r
+@@ -572,4 +583,7 @@\r
+ dup2(outFile, 1);\r
+ close(outFile);\r
++ dup2(compressPipe[1], 2);\r
++ close(compressPipe[0]);\r
++ close(compressPipe[1]);\r
+ \r
+ if (switch_user_permanently(log) != 0) {\r
+@@ -581,4 +595,15 @@\r
+ }\r
+ \r
++ close(compressPipe[1]);\r
++ while ((i = read(compressPipe[0], buff, sizeof(buff) - 1)) > 0) {\r
++ if (!error_printed) {\r
++ error_printed = 1;\r
++ message(MESS_ERROR, "Compressing program wrote following message "\r
++ "to stderr when compressing log %s:\n", name);\r
++ }\r
++ buff[i] = '\0';\r
++ fprintf(stderr, "%s", buff);\r
++ }\r
++ close(compressPipe[0]);\r
+ wait(&status);\r
+ \r
+\r
Summary(uk.UTF-8): Ротує, компресує, видаляє та відправляє поштою лог-файли
Name: logrotate
Version: 3.8.7
-Release: 1
+Release: 2
License: GPL v2
Group: Applications/System
Source0: https://fedorahosted.org/releases/l/o/logrotate/%{name}-%{version}.tar.gz
Source4: %{name}.crontab
Patch1: %{name}-man.patch
Patch2: tabooext.patch
+Patch3: logrotate-print-prog-name.patch
URL: https://fedorahosted.org/logrotate/
%{?with_acl:BuildRequires: acl-devel}
%if %{with selinux}
%setup -q
%patch1 -p1
%patch2 -p1
+%patch3 -p2
%build
%{__make} \
CC="%{__cc}" \
- RPM_OPT_FLAGS="%{rpmcflags}" \
+ RPM_OPT_FLAGS="%{rpmcflags} %{rpmcppflags}" \
WITH_ACL=%{?with_acl:yes}%{!?with_acl:no} \
WITH_SELINUX=%{?with_selinux:yes}%{!?with_selinux:no} \
STATEFILE="%{statdir}/logrotate.status"