unsigned int mandatory :1,
blocked :1;
uint64_t size;
+ int fd;
int id;
};
return;
}
- new_head = xmalloc(sizeof(*l));
+ new_head = xmalloc(sizeof(*new_head));
new_head->dev = l->dev;
new_head->inode = l->inode;
INIT_LIST_HEAD(&new_head->chain);
size_t sz;
struct lock *l = xcalloc(1, sizeof(*l));
INIT_LIST_HEAD(&l->locks);
+ l->fd = -1;
bool cmdname_unknown = false;
}
static int get_pid_lock(void *locks, void (*add_lock)(void *, struct lock *), FILE *fp,
- pid_t pid, const char *cmdname)
+ pid_t pid, const char *cmdname, int fd)
{
char buf[PATH_MAX];
struct override_info oinfo = {
if (strncmp(buf, "lock:\t", 6))
continue;
l = get_lock(buf + 6, &oinfo, NULL);
- if (l)
+ if (l) {
add_lock(locks, l);
+ l->fd = fd;
+ }
/* no break here.
Multiple recode locks can be taken via one fd. */
}
if (fdinfo == NULL)
continue;
- get_pid_lock(locks, add_lock, fdinfo, pid, cmdname);
+ get_pid_lock(locks, add_lock, fdinfo, pid, cmdname, (int)num);
fclose(fdinfo);
}