return inum;
}
-static struct lock *get_local_lock(char *buf)
+static struct lock *get_lock(char *buf)
{
int i;
char *tok = NULL;
return l;
}
-static int get_local_locks(struct list_head *locks)
+static int get_proc_locks(struct list_head *locks)
{
FILE *fp;
char buf[PATH_MAX];
return -1;
while (fgets(buf, sizeof(buf), fp)) {
- struct lock *l = get_local_lock(buf);
+ struct lock *l = get_lock(buf);
if (l)
list_add(&l->locks, locks);
}
int main(int argc, char *argv[])
{
int c, rc = 0;
- struct list_head locks;
+ struct list_head proc_locks;
char *outarg = NULL;
enum {
OPT_OUTPUT_ALL = CHAR_MAX + 1
}
}
- INIT_LIST_HEAD(&locks);
+ INIT_LIST_HEAD(&proc_locks);
if (!ncolumns) {
/* default columns */
scols_init_debug(0);
- rc = get_local_locks(&locks);
+ rc = get_proc_locks(&proc_locks);
- if (!rc && !list_empty(&locks))
- rc = show_locks(&locks, target_pid);
+ if (!rc && !list_empty(&proc_locks))
+ rc = show_locks(&proc_locks, target_pid);
mnt_unref_table(tab);
return rc;