summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-02-13 22:02:40 +0100
committerLennart Poettering <lennart@poettering.net>2013-02-13 22:02:40 +0100
commit9db11a99beaf25f6eb948348202a4c783e1d31a6 (patch)
tree85096e1a6a0a99320b9557217348b51b13f9669c /src/shared/util.c
parent61cc634bc208b264bd2fbe6af241b345a2002509 (diff)
efi: efi_get_boot_options() should already sort the entries, the random order in the efivars fs is probably not useful
This also introduces a new FOREACH_DIRENT macro and makes use of it.
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index d754c836f2..4f0b652f4f 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1077,6 +1077,7 @@ int get_process_exe(pid_t pid, char **name) {
static int get_process_id(pid_t pid, const char *field, uid_t *uid) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ char *p = NULL;
+ char line[LINE_MAX];
assert(field);
assert(uid);
@@ -1091,7 +1092,7 @@ static int get_process_id(pid_t pid, const char *field, uid_t *uid) {
if (!f)
return -errno;
- FOREACH_LINE(f, line, return -errno) {
+ FOREACH_LINE(line, f, return -errno) {
char *l;
l = strstrip(line);