[packages/net-snmp] actually do run second stat()
glen
glen at pld-linux.org
Sat Apr 23 17:11:46 CEST 2016
commit 55e362193b4da510f46a236709c4ba0361c2fc9a
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Apr 23 18:11:36 2016 +0300
actually do run second stat()
net-snmp.spec | 2 +-
swinst_apt.patch | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/net-snmp.spec b/net-snmp.spec
index 2714e82..b20ef33 100644
--- a/net-snmp.spec
+++ b/net-snmp.spec
@@ -444,7 +444,7 @@ SNMP dla trzech wersji tego protokołu (SNMPv3, SNMPv2c, SNMPv1).
%patch5 -p1
%patch6 -p1
%patch7 -p1
-
+%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
diff --git a/swinst_apt.patch b/swinst_apt.patch
index 7a15757..7c87245 100644
--- a/swinst_apt.patch
+++ b/swinst_apt.patch
@@ -56,14 +56,14 @@ Signed-Off-By: Elan Ruusamäe <glen at pld-linux.org>
+ char arch[SNMP_MAXBUF];
char status[SNMP_MAXBUF];
char buf[BUFSIZ];
-+ struct stat stat_buf;
++ struct stat stat_buf;
netsnmp_swinst_entry *entry;
+ u_char *date_buf;
+ size_t date_len;
int i = 0;
if (p == NULL) {
-@@ -78,20 +86,37 @@
+@@ -78,20 +86,39 @@
continue; /* error already logged by function */
CONTAINER_INSERT(container, entry);
@@ -92,9 +92,11 @@ Signed-Off-By: Elan Ruusamäe <glen at pld-linux.org>
+ } else {
+ /* somewhy some files include :arch in .list name */
+ snprintf(file, sizeof(file), "%s/%s:%s.list", pkg_directory, package, arch);
-+ date_buf = date_n_time(&stat_buf.st_mtime, &date_len);
-+ entry->swDate_len = date_len;
-+ memcpy(entry->swDate, date_buf, entry->swDate_len);
++ if(stat(file, &stat_buf) != -1) {
++ date_buf = date_n_time(&stat_buf.st_mtime, &date_len);
++ entry->swDate_len = date_len;
++ memcpy(entry->swDate, date_buf, entry->swDate_len);
++ }
+ }
+ /* FIXME, or fallback to whatever nonsesnse was here before, or leave it uninitialied?
+ else {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/net-snmp.git/commitdiff/55e362193b4da510f46a236709c4ba0361c2fc9a
More information about the pld-cvs-commit
mailing list