]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
actually do run second stat()
authorElan Ruusamäe <glen@delfi.ee>
Sat, 23 Apr 2016 15:11:36 +0000 (18:11 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 23 Apr 2016 15:11:36 +0000 (18:11 +0300)
net-snmp.spec
swinst_apt.patch

index 2714e82f5cab5351f94c9fa371e4d0e7fa1721c0..b20ef33dcd6c4b3ab9e14f056ca2192b56114f31 100644 (file)
@@ -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
index 7a157572cbbbfffc0065155c51e89064204351bb..7c8724581716cb48cf7761643f7bd439f4147179 100644 (file)
@@ -56,14 +56,14 @@ Signed-Off-By: Elan Ruusamäe <glen@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@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 {
This page took 0.159264 seconds and 4 git commands to generate.