ioctl() IOCTL_STAT use path instead of already open io handle
This commit is contained in:
@ -18,7 +18,7 @@ void fs_fetch(void) {
|
||||
|
||||
IoctlStat statbuf; ZERO(&statbuf);
|
||||
|
||||
ioctl(ioh, IOCTL_STAT, (uint64_t)&statbuf, 0, 0);
|
||||
ioctl(ioh, IOCTL_STAT, (uint64_t)&statbuf, (uint64_t)path, 0);
|
||||
if (statbuf.type == IOCTLSTAT_FILE) {
|
||||
uint8_t *buf = umalloc(statbuf.size+1);
|
||||
string_memset(buf, 0, statbuf.size+1);
|
||||
@ -31,5 +31,8 @@ void fs_fetch(void) {
|
||||
}
|
||||
|
||||
uprintf("%s", buf);
|
||||
ufree(buf);
|
||||
}
|
||||
|
||||
ioctl(ioh, IOCTL_CLOSEF, 0, 0, 0);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ void do_file(char *filepath) {
|
||||
|
||||
IoctlStat statbuf; ZERO(&statbuf);
|
||||
|
||||
ioctl(ioh, IOCTL_STAT, (uint64_t)&statbuf, 0, 0);
|
||||
ioctl(ioh, IOCTL_STAT, (uint64_t)&statbuf, (uint64_t)filepath, 0);
|
||||
if (statbuf.type != IOCTLSTAT_FILE) {
|
||||
LOG(LOG_ERR, "%s is not a file (%d)\n", filepath, statbuf.type);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user