Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new fixes for UEFI support #351

Merged
merged 3 commits into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/lkl/include/lkl.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ struct lkl_netdev *lkl_netdev_macvtap_create(const char *path, int offload);
* If you run the program from shell script, make sure you ignore SIGTSTP by
* "trap '' TSTP" in the shell script.
*/
void lkl_register_dbg_handler();
void lkl_register_dbg_handler(void);

/**
* lkl_add_neighbor - add a permanent arp entry
Expand Down
12 changes: 9 additions & 3 deletions tools/lkl/lib/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static int encode_dev_from_sysfs(const char *sysfs_path, uint32_t *pdevid)
long fd;
int major, minor;
char buf[16] = { 0, };
char *bufptr;

fd = lkl_sys_open(sysfs_path, LKL_O_RDONLY, 0);
if (fd < 0)
Expand All @@ -94,11 +95,16 @@ static int encode_dev_from_sysfs(const char *sysfs_path, uint32_t *pdevid)
goto out_close;
}

ret = sscanf(buf, "%d:%d", &major, &minor);
if (ret != 2) {
bufptr = strchr(buf, ':');
if (bufptr == NULL) {
ret = -LKL_EINVAL;
goto out_close;
}
bufptr[0] = '\0';
bufptr++;

major = atoi(buf);
minor = atoi(bufptr);

*pdevid = new_encode_dev(major, minor);
ret = 0;
Expand Down Expand Up @@ -356,7 +362,7 @@ struct lkl_dir *lkl_fdopendir(int fd, int *err)

void lkl_rewinddir(struct lkl_dir *dir)
{
lkl_sys_lseek(dir->fd, 0, SEEK_SET);
lkl_sys_lseek(dir->fd, 0, LKL_SEEK_SET);
dir->len = 0;
dir->pos = NULL;
}
Expand Down