summaryrefslogtreecommitdiffstats
path: root/misc-utils/lslocks.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:23:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:23:00 +0000
commit803b3a091c225d48395508a8f9ffa6e08cbddc5b (patch)
treea3168c9e7da8991c423b5978aacf90c3c2b135c1 /misc-utils/lslocks.c
parentReleasing progress-linux version 2.40-8~progress7.99u1. (diff)
downloadutil-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.tar.xz
util-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.zip
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'misc-utils/lslocks.c')
-rw-r--r--misc-utils/lslocks.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index 3d70b04..a630c3d 100644
--- a/misc-utils/lslocks.c
+++ b/misc-utils/lslocks.c
@@ -89,7 +89,7 @@ static struct colinfo infos[] = {
[COL_END] = { "END", 10, SCOLS_FL_RIGHT, N_("ending offset of the lock")},
[COL_PATH] = { "PATH", 0, SCOLS_FL_TRUNC, N_("path of the locked file")},
[COL_BLOCKER] = { "BLOCKER", 0, SCOLS_FL_RIGHT, N_("PID of the process blocking the lock") },
- [COL_HOLDERS] = { "HOLDERS", 0, SCOLS_FL_WRAP, N_("HOLDERS of the lock") },
+ [COL_HOLDERS] = { "HOLDERS", 0, SCOLS_FL_WRAP, N_("holders of the lock") },
};
static int columns[ARRAY_SIZE(infos) * 2];
@@ -490,12 +490,11 @@ static int get_pid_locks(void *locks, void (*add_lock)(void *, struct lock *), s
return rc;
}
-static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *))
+static void get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *))
{
DIR *dir;
struct dirent *d;
struct path_cxt *pc = NULL;
- int rc = 0;
pc = ul_new_path(NULL);
if (!pc)
@@ -513,10 +512,8 @@ static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *))
if (procfs_dirent_get_pid(d, &pid) != 0)
continue;
- if (procfs_process_init_path(pc, pid) != 0) {
- rc = -1;
- break;
- }
+ if (procfs_process_init_path(pc, pid) != 0)
+ continue;
if (procfs_process_get_cmdname(pc, buf, sizeof(buf)) <= 0)
continue;
@@ -528,7 +525,7 @@ static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *))
closedir(dir);
ul_unref_path(pc);
- return rc;
+ return;
}
static int get_proc_locks(void *locks, void (*add_lock)(void *, struct lock *), void *fallback)