mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Add fixes from Takayuki Sasaki <sasaki@bsd.tnes.nec.co.jp>
call mk_daemon from a different place so we don't close the dmapi device.
This commit is contained in:
@@ -111,6 +111,13 @@ main(
|
||||
logfile = LOG_DEFAULT;
|
||||
|
||||
|
||||
/*
|
||||
* Turn ourselves into a daemon
|
||||
*/
|
||||
error = mk_daemon(logfile);
|
||||
if (error)
|
||||
exit(1);
|
||||
|
||||
/*
|
||||
* Now we have our filesystem name and possibly a size threshold
|
||||
* to look for. Init the dmapi, and get a filesystem handle so
|
||||
@@ -125,13 +132,6 @@ main(
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Turn ourselves into a daemon
|
||||
*/
|
||||
error = mk_daemon(logfile);
|
||||
if (error)
|
||||
exit(1);
|
||||
|
||||
|
||||
/*
|
||||
* Set the event disposition so that our session will receive
|
||||
|
||||
@@ -469,6 +469,7 @@ extract_fields(
|
||||
char *cp, *start;
|
||||
size_t len;
|
||||
char *hanp;
|
||||
char *hanpp=NULL;
|
||||
|
||||
/*
|
||||
* Skip any leading white space, and check the length
|
||||
@@ -505,8 +506,9 @@ extract_fields(
|
||||
cp += len*2;
|
||||
*cp = '\0';
|
||||
|
||||
atohan( hanp, (void**)&handle_buf, &len );
|
||||
|
||||
atohan( hanp, (void**)&hanpp, &len );
|
||||
memcpy( handle_buf, hanpp, len);
|
||||
free( hanpp );
|
||||
|
||||
/* skip over white space */
|
||||
while (!isalnum(*cp))
|
||||
|
||||
@@ -453,7 +453,7 @@ clear_mrgns(
|
||||
size_t hlen,
|
||||
dm_token_t token)
|
||||
{
|
||||
dm_region_t *rgn;
|
||||
dm_region_t *rgn, *sv_rgn;
|
||||
u_int nregions, nret;
|
||||
u_int exact_flag;
|
||||
int i;
|
||||
@@ -502,6 +502,8 @@ clear_mrgns(
|
||||
}
|
||||
}
|
||||
|
||||
sv_rgn = rgn;
|
||||
|
||||
/*
|
||||
* Clear all the managed regions
|
||||
*/
|
||||
@@ -511,6 +513,8 @@ clear_mrgns(
|
||||
rgn->rg_flags = DM_REGION_NOEVENT;
|
||||
rgn++;
|
||||
}
|
||||
rgn = sv_rgn;
|
||||
|
||||
error = dm_set_region(sid, hanp, hlen, token, nregions, rgn,
|
||||
&exact_flag);
|
||||
if (error == -1) {
|
||||
|
||||
Reference in New Issue
Block a user