diff options
author | Karel Zak <kzak@redhat.com> | 2016-11-07 11:43:12 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-11-09 10:02:32 +0100 |
commit | a5c4535b0df9e122025d804b27831dc1d38c73a9 (patch) | |
tree | 6220b237c28a80b0076e9cf1352324762495ff77 | |
parent | 6ca268eca7d5300614b9b115ddd0d807c7d633c5 (diff) | |
download | util-linux-a5c4535b0df9e122025d804b27831dc1d38c73a9.tar.gz |
lsmem: add Copyright
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | sys-utils/chmem.c | 3 | ||||
-rw-r--r-- | sys-utils/lsmem.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c index cc681b84c4..14f5aa48d2 100644 --- a/sys-utils/chmem.c +++ b/sys-utils/chmem.c @@ -17,7 +17,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -78,6 +77,7 @@ static int chmem_size(struct chmem_desc *desc, int enable) size = desc->size; onoff = enable ? "online" : "offline"; i = enable ? 0 : desc->ndirs - 1; + for (; i >= 0 && i < desc->ndirs && size; i += enable ? 1 : -1) { name = desc->dirs[i]->d_name; index = strtou64_or_err(name + 6, _("Failed to parse index")); @@ -123,6 +123,7 @@ static int chmem_range(struct chmem_desc *desc, int enable) todo = desc->end - desc->start + 1; onoff = enable ? "online" : "offline"; + for (i = 0; i < desc->ndirs; i++) { name = desc->dirs[i]->d_name; index = strtou64_or_err(name + 6, _("Failed to parse index")); diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c index 1dcf8a8e40..2210339a3b 100644 --- a/sys-utils/lsmem.c +++ b/sys-utils/lsmem.c @@ -2,6 +2,7 @@ * lsmem - Show memory configuration * * Copyright IBM Corp. 2016 + * Copyright (C) 2016 Karel Zak <kzak@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include <c.h> #include <nls.h> #include <path.h> |