Skip to content

Commit

Permalink
Merge pull request torvalds#351 from M1cha/uefi-support
Browse files Browse the repository at this point in the history
new fixes for UEFI support
  • Loading branch information
tavip committed Jul 11, 2017
2 parents 768a3db + 92d2f6d commit 50ad8d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/lkl/include/lkl.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,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 @@ int lkl_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 @@ int lkl_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

0 comments on commit 50ad8d6

Please sign in to comment.