~ubuntu-branches/ubuntu/lucid/silo/lucid

« back to all changes in this revision

Viewing changes to debian/patches/11-silocheck_non-failure_on_stat.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2008-06-24 13:04:51 UTC
  • mfrom: (15.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080624130451-b6kozclk7a6thvrp
Tags: 1.4.14-0ubuntu1
* New upstream release:
  - Drop local patches that have been merged upstream.
  - Update debian/copyright to reflect new tarball release URL.
  - Add patch to fix FTBFS (stolen from Fedora).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -ruN a/silo/silocheck.c b/silo/silocheck.c
2
 
--- a/silo/silocheck.c        2006-06-01 17:24:53.000000000 +0000
3
 
+++ b/silo/silocheck.c       2007-08-13 15:26:21.000000000 +0000
4
 
@@ -22,6 +22,7 @@
5
 
 #include "../second/fs/ufs.c"
6
 
 #endif
7
 
 
8
 
+#include <errno.h>
9
 
 #include <stdio.h>
10
 
 #include <stdarg.h>
11
 
 #include <string.h>
12
 
@@ -254,7 +255,11 @@
13
 
     p = strchr (name, 0);
14
 
     while ((dir = readdir(dp)) != NULL) {
15
 
         strcpy(p,dir->d_name);
16
 
-        if (stat(name,&s) < 0) return NULL;
17
 
+        /*
18
 
+         * It is possible that we got an unresolved symlink under /dev.
19
 
+         * Such a file will make silocheck fail and we do not want this.
20
 
+         */
21
 
+        if (stat(name,&s) < 0 && errno != ENOENT) return NULL;
22
 
         if (S_ISBLK(s.st_mode) && s.st_rdev == number) return name;
23
 
     }
24
 
     return NULL;