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:
Dean Roehrich
2001-10-01 21:39:50 +00:00
parent ca1fb7f3a5
commit ebdd1ec32c
3 changed files with 16 additions and 10 deletions
+7 -7
View File
@@ -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
+4 -2
View File
@@ -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))
+5 -1
View File
@@ -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) {