Bug #839 ยป kvm-fwmem.patch
lib/libkvm/kvm.c 11 Nov 2007 15:55:14 -0000 | ||
---|---|---|
_kvm_syserr(kd, kd->program, "%s", mf);
|
||
goto failed;
|
||
}
|
||
if (S_ISREG(st.st_mode) && st.st_size <= 0) {
|
||
errno = EINVAL;
|
||
_kvm_syserr(kd, kd->program, "empty file");
|
||
goto failed;
|
||
}
|
||
if (fcntl(kd->pmfd, F_SETFD, FD_CLOEXEC) < 0) {
|
||
_kvm_syserr(kd, kd->program, "%s", mf);
|
||
goto failed;
|
||
... | ... | |
*/
|
||
if (strcmp(mf, _PATH_DEVNULL) == 0) {
|
||
kd->vmfd = open(_PATH_DEVNULL, O_RDONLY);
|
||
} else if (strcmp(mf, _PATH_MEM) != 0) {
|
||
_kvm_err(kd, kd->program,
|
||
"%s: not physical memory device", mf);
|
||
goto failed;
|
||
} else {
|
||
if ((kd->vmfd = open(_PATH_KMEM, flag)) < 0) {
|
||
_kvm_syserr(kd, kd->program, "%s", _PATH_KMEM);
|
||
... | ... | |
return NULL;
|
||
}
|
||
}
|
||
cc = read(kd->vmfd, &ch, 1);
|
||
cc = read(kd->pmfd, &ch, 1);
|
||
if ((ssize_t)cc < 0) {
|
||
_kvm_syserr(kd, 0, "kvm_readstr");
|
||
return NULL;
|