chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed statfs.f_type signed vs unsigned comparisons
[elogind.git]
/
src
/
readahead
/
readahead-analyze.c
diff --git
a/src/readahead/readahead-analyze.c
b/src/readahead/readahead-analyze.c
index 53892b0cf862bf03a60d1e6348e3de3dfb6c8b53..e24b2a32985d041439afc709ffa16e1c3166f828 100644
(file)
--- a/
src/readahead/readahead-analyze.c
+++ b/
src/readahead/readahead-analyze.c
@@
-34,10
+34,10
@@
int main_analyze(const char *pack_path) {
char line[LINE_MAX];
int main_analyze(const char *pack_path) {
char line[LINE_MAX];
- FILE
*pack
;
+ FILE
_cleanup_fclose_ *pack = NULL
;
int a;
int missing = 0;
int a;
int missing = 0;
-
off
_t tsize = 0;
+
size
_t tsize = 0;
if (!pack_path)
pack_path = "/.readahead";
if (!pack_path)
pack_path = "/.readahead";
@@
-105,7
+105,7
@@
int main_analyze(const char *pack_path) {
}
if (stat(path, &st) == 0) {
}
if (stat(path, &st) == 0) {
-
off
_t size;
+
size
_t size;
if (sections == 0)
size = st.st_size;
if (sections == 0)
size = st.st_size;
@@
-114,10
+114,10
@@
int main_analyze(const char *pack_path) {
tsize += size;
tsize += size;
- printf(" %4
d%% (%2d) %12l
d: %s\n",
- sections
? (int) (size * 100 / st.st_size)
: 100,
+ printf(" %4
zd%% (%2d) %12z
d: %s\n",
+ sections
&& st.st_size ? size * 100 / st.st_size
: 100,
sections ? sections : 1,
sections ? sections : 1,
-
(unsigned long)
size,
+ size,
path);
} else {
printf(" %4dp (%2d) %12s: %s (MISSING)\n",
path);
} else {
printf(" %4dp (%2d) %12s: %s (MISSING)\n",
@@
-130,12
+130,10
@@
int main_analyze(const char *pack_path) {
}
}
- fclose(pack);
-
printf("\nHOST: %s"
"TYPE: %c\n"
"MISSING: %d\n"
printf("\nHOST: %s"
"TYPE: %c\n"
"MISSING: %d\n"
- "TOTAL: %
ld
\n",
+ "TOTAL: %
zu
\n",
line,
a,
missing,
line,
a,
missing,
@@
-144,6
+142,5
@@
int main_analyze(const char *pack_path) {
return EXIT_SUCCESS;
fail:
return EXIT_SUCCESS;
fail:
- fclose(pack);
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}