- hv: hypervvssd: call endmntent before call setmntent again
OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=112
This commit is contained in:
parent
a4562a9fe2
commit
7259a4ff7b
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 30 11:25:47 UTC 2015 - ohering@suse.de
|
||||||
|
|
||||||
|
- hv: hypervvssd: call endmntent before call setmntent again
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 16 15:23:18 UTC 2015 - ohering@suse.de
|
Thu Apr 16 15:23:18 UTC 2015 - ohering@suse.de
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ static int vss_operate(int operation)
|
|||||||
char match[] = "/dev/";
|
char match[] = "/dev/";
|
||||||
FILE *mounts;
|
FILE *mounts;
|
||||||
struct mntent *ent;
|
struct mntent *ent;
|
||||||
|
char errdir[1024] = {0};
|
||||||
unsigned int cmd;
|
unsigned int cmd;
|
||||||
int error = 0, root_seen = 0, save_errno = 0;
|
int error = 0, root_seen = 0, save_errno = 0;
|
||||||
|
|
||||||
@ -116,6 +117,8 @@ static int vss_operate(int operation)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
endmntent(mounts);
|
||||||
|
|
||||||
if (root_seen) {
|
if (root_seen) {
|
||||||
error |= vss_do_freeze("/", cmd);
|
error |= vss_do_freeze("/", cmd);
|
||||||
if (error && operation == VSS_OP_FREEZE)
|
if (error && operation == VSS_OP_FREEZE)
|
||||||
@ -125,16 +128,19 @@ static int vss_operate(int operation)
|
|||||||
goto out;
|
goto out;
|
||||||
err:
|
err:
|
||||||
save_errno = errno;
|
save_errno = errno;
|
||||||
|
if (ent) {
|
||||||
|
strncpy(errdir, ent->mnt_dir, sizeof(errdir)-1);
|
||||||
|
endmntent(mounts);
|
||||||
|
}
|
||||||
vss_operate(VSS_OP_THAW);
|
vss_operate(VSS_OP_THAW);
|
||||||
/* Call syslog after we thaw all filesystems */
|
/* Call syslog after we thaw all filesystems */
|
||||||
if (ent)
|
if (ent)
|
||||||
syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s",
|
syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s",
|
||||||
ent->mnt_dir, save_errno, strerror(save_errno));
|
errdir, save_errno, strerror(save_errno));
|
||||||
else
|
else
|
||||||
syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno,
|
syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno,
|
||||||
strerror(save_errno));
|
strerror(save_errno));
|
||||||
out:
|
out:
|
||||||
endmntent(mounts);
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user