author | Stephen Gaul Jr <steve.gaul@oracle.com> |
Fri, 03 Jun 2016 09:30:42 -0700 | |
changeset 6133 | 73641150a4de |
permissions | -rw-r--r-- |
6133
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
1 |
In-house patch created for studio compiler and userland build environment. |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
2 |
This is similar to upstream patch for missing d_type field on SunOS. |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
3 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
4 |
This patch is Solaris buildenv specific and may not be suitable for upstream. |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
5 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
6 |
--- pcsc-lite-1.8.14/src/configfile.c 2015-04-29 15:23:11.000000000 -0400 |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
7 |
+++ pcsc-lite-1.8.14/src/configfile.c 2016-05-05 16:41:12.704546283 -0400 |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
8 |
@@ -2012,37 +2012,28 @@ |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
9 |
while ((direntry = readdir(dir)) != NULL) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
10 |
{ |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
11 |
char filename[FILENAME_MAX]; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
12 |
+ struct stat st; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
13 |
int r; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
14 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
15 |
snprintf(filename, sizeof(filename), "%s/%s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
16 |
readerconf_dir, direntry->d_name); |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
17 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
18 |
/* skip non regular files */ |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
19 |
- if (direntry->d_type == DT_UNKNOWN) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
20 |
- { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
21 |
- struct stat st; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
22 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
23 |
- if (lstat(filename, &st) != 0) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
24 |
- { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
25 |
- Log2(PCSC_LOG_DEBUG, "Skipping non statable file: %s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
26 |
- direntry->d_name); |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
27 |
- continue; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
28 |
- } |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
29 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
30 |
- if (!S_ISREG(st.st_mode)) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
31 |
- { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
32 |
- Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
33 |
+ if (lstat(direntry->d_name, &st) != 0) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
34 |
+ { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
35 |
+ |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
36 |
+ Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
37 |
direntry->d_name); |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
38 |
- continue; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
39 |
- } |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
40 |
+ continue; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
41 |
} |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
42 |
- else |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
43 |
- if (direntry->d_type != DT_REG) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
44 |
- { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
45 |
- Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
46 |
- direntry->d_name); |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
47 |
- continue; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
48 |
- } |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
49 |
+ if (!S_ISREG(st.st_mode)) |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
50 |
+ { |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
51 |
+ Log2(PCSC_LOG_DEBUG, "Skipping non regular file: %s", |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
52 |
+ direntry->d_name); |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
53 |
+ continue; |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
54 |
+ } |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
55 |
|
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
56 |
/* skip files starting with . like ., .., .svn, etc */ |
73641150a4de
PSARC/2016/217 Smartcard Reintroduction
Stephen Gaul Jr <steve.gaul@oracle.com>
parents:
diff
changeset
|
57 |
if ('.' == direntry->d_name[0]) |