chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix size_t compiler warning on 32 bit platforms
[elogind.git]
/
udev
/
udev-rules.c
diff --git
a/udev/udev-rules.c
b/udev/udev-rules.c
index 40947685d0125ffb3b2b789eddf2694a2093a0be..4713352826d524daaff101ee72dcd31d85af19fa 100644
(file)
--- a/
udev/udev-rules.c
+++ b/
udev/udev-rules.c
@@
-1528,7
+1528,6
@@
static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
static int add_matching_files(struct udev *udev, struct udev_list_node *file_list, const char *dirname, const char *suffix)
{
static int add_matching_files(struct udev *udev, struct udev_list_node *file_list, const char *dirname, const char *suffix)
{
- struct dirent *ent;
DIR *dir;
char filename[UTIL_PATH_SIZE];
DIR *dir;
char filename[UTIL_PATH_SIZE];
@@
-1540,26
+1539,28
@@
static int add_matching_files(struct udev *udev, struct udev_list_node *file_lis
}
while (1) {
}
while (1) {
- ent = readdir(dir);
- if (ent == NULL || ent->d_name[0] == '\0')
+ struct dirent *dent;
+
+ dent = readdir(dir);
+ if (dent == NULL || dent->d_name[0] == '\0')
break;
break;
- if (
(ent->d_name[0] == '.') || (ent->d_name[0] == '#')
)
+ if (
dent->d_name[0] == '.'
)
continue;
/* look for file matching with specified suffix */
if (suffix != NULL) {
const char *ext;
continue;
/* look for file matching with specified suffix */
if (suffix != NULL) {
const char *ext;
- ext = strrchr(ent->d_name, '.');
+ ext = strrchr(
d
ent->d_name, '.');
if (ext == NULL)
continue;
if (strcmp(ext, suffix) != 0)
continue;
}
if (ext == NULL)
continue;
if (strcmp(ext, suffix) != 0)
continue;
}
- dbg(udev, "put file '%s/%s' into list\n", dirname, ent->d_name);
+ dbg(udev, "put file '%s/%s' into list\n", dirname,
d
ent->d_name);
- snprintf(filename, sizeof(filename), "%s/%s", dirname, ent->d_name);
+ snprintf(filename, sizeof(filename), "%s/%s", dirname,
d
ent->d_name);
filename[sizeof(filename)-1] = '\0';
udev_list_entry_add(udev, file_list, filename, NULL, 1, 1);
}
filename[sizeof(filename)-1] = '\0';
udev_list_entry_add(udev, file_list, filename, NULL, 1, 1);
}
@@
-1709,7
+1710,7
@@
struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
rules->buf_max = rules->buf_cur;
}
}
rules->buf_max = rules->buf_cur;
}
}
- info(udev, "shrunk to %
l
u bytes tokens (%u * %zu bytes), %zu bytes buffer\n",
+ info(udev, "shrunk to %
z
u bytes tokens (%u * %zu bytes), %zu bytes buffer\n",
rules->token_max * sizeof(struct token), rules->token_max, sizeof(struct token), rules->buf_max);
/* cleanup uid/gid cache */
rules->token_max * sizeof(struct token), rules->token_max, sizeof(struct token), rules->buf_max);
/* cleanup uid/gid cache */