Skip to content

Commit cc49275

Browse files
committed
libast: Update cdt(3): Allow empty strings in (dt)trees
This backports most of the Cdt (container data types) mechanism from the ksh 93v- beta, based on ground work done by OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-dttree-crash.dif plus adaptations to match ksh 93u+m and an updated manual page (src/lib/libast/man/cdt.3) added directly from the 93v- sources. | Thu Dec 20 12:48:02 UTC 2012 - werner@suse.de | | - Add ksh93-dttree-crash.dif - Allow empty strings in (dt)trees | (bnc#795324) | | Fri Oct 25 14:07:57 UTC 2013 - werner@suse.de | | - Rework patch ksh93-dttree-crash.dif As usual, precious little information is available because the OpenSUSE bug report is currently closed to the public: https://bugzilla.opensuse.org/show_bug.cgi?id=795324 However, a cursory inspection suggests that this code contains improvements to do with concurrent processing and related robustness. The new cdt.3 manual page adds a lot about that. This has been in production use on OpenSUSE for a long time, so hopefully this will make ksh a little more stable again. Only one way to find out: let's commit and test this... BTW, to get a nice manual, use groff and ghostscript's ps2pdf: $ groff -tman src/lib/libast/man/cdt.3 | ps2pdf - cdt.3.pdf
1 parent aa2644a commit cc49275

File tree

21 files changed

+710
-212
lines changed

21 files changed

+710
-212
lines changed

src/cmd/ksh93/sh/arith.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int as
184184
{
185185
ap = nv_arrayptr(np);
186186
if(ap && !ap->table)
187+
{
187188
ap->table = dtopen(&_Nvdisc,Dtoset);
189+
dtuserdata(ap->table,shp,1);
190+
}
188191
if(ap && ap->table && (nq=nv_search(nv_getsub(np),ap->table,NV_ADD)))
189192
nq->nvenv = (char*)np;
190193
if(nq && nv_isnull(nq))

src/cmd/ksh93/sh/array.c

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static Namarr_t *array_scope(Namval_t *np, Namarr_t *ap, int flags)
9595
if(is_associative(aq))
9696
{
9797
aq->scope = (void*)dtopen(&_Nvdisc,Dtoset);
98+
dtuserdata(aq->scope,&sh,1);
9899
dtview((Dt_t*)aq->scope,aq->table);
99100
aq->table = (Dt_t*)aq->scope;
100101
return(aq);
@@ -373,7 +374,10 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
373374
{
374375
char *cp;
375376
if(!ap->header.table)
377+
{
376378
ap->header.table = dtopen(&_Nvdisc,Dtoset);
379+
dtuserdata(ap->header.table,&sh,1);
380+
}
377381
sfprintf(sh.strbuf,"%d",ap->cur);
378382
cp = sfstruse(sh.strbuf);
379383
mp = nv_search(cp, ap->header.table, NV_ADD);
@@ -410,7 +414,10 @@ int nv_arraysettype(Namval_t *np, Namval_t *tp, const char *sub, int flags)
410414
av[1] = 0;
411415
sh.last_table = 0;
412416
if(!ap->table)
417+
{
413418
ap->table = dtopen(&_Nvdisc,Dtoset);
419+
dtuserdata(ap->table,&sh,1);
420+
}
414421
if(nq = nv_search(sub, ap->table, NV_ADD))
415422
{
416423
if(!nq->nvfun && nq->nvalue.cp && *nq->nvalue.cp==0)
@@ -452,7 +459,6 @@ static Namfun_t *array_clone(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp
452459
int nelem, skipped=0;
453460
Dt_t *otable=ap->table;
454461
struct index_array *aq = (struct index_array*)ap, *ar;
455-
Shell_t *shp = sh_getinterp();
456462
if(flags&NV_MOVE)
457463
{
458464
if((flags&NV_COMVAR) && nv_putsub(np,NIL(char*),ARRAY_SCAN))
@@ -485,6 +491,7 @@ static Namfun_t *array_clone(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp
485491
if(ap->table)
486492
{
487493
ap->table = dtopen(&_Nvdisc,Dtoset);
494+
dtuserdata(ap->table,&sh,1);
488495
if(ap->scope && !(flags&NV_COMVAR))
489496
{
490497
ap->scope = ap->table;
@@ -855,6 +862,7 @@ static struct index_array *array_grow(Namval_t *np, register struct index_array
855862
if(nv_hasdisc(np,&array_disc) || (nv_type(np) && nv_isvtree(np)))
856863
{
857864
ap->header.table = dtopen(&_Nvdisc,Dtoset);
865+
dtuserdata(ap->header.table,&sh,1);
858866
mp = nv_search("0", ap->header.table,NV_ADD);
859867
if(mp && nv_isnull(mp))
860868
{
@@ -1180,15 +1188,14 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
11801188
{
11811189
if(sp)
11821190
{
1183-
Shell_t *shp = sh_getinterp();
11841191
if(ap && ap->xp && !strmatch(sp,"+([0-9])"))
11851192
{
11861193
Namval_t *mp = nv_namptr(ap->xp,0);
11871194
nv_putval(mp, sp,0);
11881195
size = nv_getnum(mp);
11891196
}
11901197
else
1191-
size = (int)sh_arith(shp,(char*)sp);
1198+
size = (int)sh_arith(&sh,(char*)sp);
11921199
}
11931200
if(size <0 && ap)
11941201
size += array_maxindex(np);
@@ -1242,7 +1249,10 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
12421249
char *cp;
12431250
Namval_t *mp;
12441251
if(!ap->header.table)
1252+
{
12451253
ap->header.table = dtopen(&_Nvdisc,Dtoset);
1254+
dtuserdata(ap->header.table,&sh,1);
1255+
}
12461256
sfprintf(sh.strbuf,"%d",ap->cur);
12471257
cp = sfstruse(sh.strbuf);
12481258
mp = nv_search(cp, ap->header.table, NV_ADD);
@@ -1379,7 +1389,6 @@ static void array_fixed_setdata(Namval_t *np,Namarr_t* ap,struct fixed_array* fp
13791389

13801390
static int array_fixed_init(Namval_t *np, char *sub, char *cp)
13811391
{
1382-
Shell_t *shp=sh_getinterp();
13831392
Namarr_t *ap;
13841393
struct fixed_array *fp;
13851394
int n=1,sz;
@@ -1403,12 +1412,12 @@ static int array_fixed_init(Namval_t *np, char *sub, char *cp)
14031412
fp->max = (int*)(fp+1);
14041413
fp->incr = fp->max+n;
14051414
fp->cur = fp->incr+n;
1406-
fp->max[0] = (int)sh_arith(shp,(char*)sub);
1415+
fp->max[0] = (int)sh_arith(&sh,(char*)sub);
14071416
for(n=1,ep=cp;*ep=='['; ep=cp)
14081417
{
14091418
cp = nv_endsubscript(np,ep,0);
14101419
cp[-1]=0;
1411-
fp->max[n++] = sz = (int)sh_arith(shp,(char*)ep+1);
1420+
fp->max[n++] = sz = (int)sh_arith(&sh,(char*)ep+1);
14121421
if(sz<0)
14131422
{
14141423
free((void*)ap);
@@ -1429,7 +1438,6 @@ static int array_fixed_init(Namval_t *np, char *sub, char *cp)
14291438

14301439
static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
14311440
{
1432-
Shell_t *shp=sh_getinterp();
14331441
Namarr_t *ap = nv_arrayptr(np);
14341442
struct fixed_array *fp = (struct fixed_array*)ap->fixed;
14351443
char *ep;
@@ -1447,7 +1455,7 @@ static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
14471455
}
14481456
else
14491457
fp->curi = 0;
1450-
size = (int)sh_arith(shp,(char*)sub);
1458+
size = (int)sh_arith(&sh,(char*)sub);
14511459
fp->cur[n] = size;
14521460
if(size >= fp->max[n] || (size < 0))
14531461
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
@@ -1459,7 +1467,7 @@ static char *array_fixed(Namval_t *np, char *sub, char *cp,int mode)
14591467
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
14601468
cp = nv_endsubscript(np,ep,0);
14611469
cp[-1]=0;
1462-
size = (int)sh_arith(shp,(char*)ep+1);
1470+
size = (int)sh_arith(&sh,(char*)ep+1);
14631471
if(size >= fp->max[n] || (size < 0))
14641472
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
14651473
fp->cur[n] = size;
@@ -1658,6 +1666,7 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
16581666
if(ap = (struct assoc_array*)calloc(1,sizeof(struct assoc_array)))
16591667
{
16601668
ap->header.table = dtopen(&_Nvdisc,Dtoset);
1669+
dtuserdata(ap->header.table,&sh,1);
16611670
ap->cur = 0;
16621671
ap->pos = 0;
16631672
ap->header.hdr.disc = &array_disc;
@@ -1730,8 +1739,7 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
17301739
case NV_ANAME:
17311740
if(ap->cur)
17321741
{
1733-
Shell_t *shp = sh_getinterp();
1734-
if(!shp->instance && nv_isnull(ap->cur))
1742+
if(!sh.instance && nv_isnull(ap->cur))
17351743
return(NIL(void*));
17361744
return((void*)ap->cur->nvname);
17371745
}

src/cmd/ksh93/sh/init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,9 +1812,13 @@ static Init_t *nv_init(Shell_t *shp)
18121812
(OPTINDNOD)->nvalue.lp = (&shp->st.optindex);
18131813
/* set up the seconds clock */
18141814
shp->alias_tree = dtopen(&_Nvdisc,Dtoset);
1815+
dtuserdata(shp->alias_tree,shp,1);
18151816
shp->track_tree = dtopen(&_Nvdisc,Dtset);
1817+
dtuserdata(shp->track_tree,shp,1);
18161818
shp->bltin_tree = sh_inittree(shp,(const struct shtable2*)shtab_builtins);
1819+
dtuserdata(shp->bltin_tree,shp,1);
18171820
shp->fun_tree = dtopen(&_Nvdisc,Dtoset);
1821+
dtuserdata(shp->fun_tree,shp,1);
18181822
dtview(shp->fun_tree,shp->bltin_tree);
18191823
nv_mount(DOTSHNOD, "type", shp->typedict=dtopen(&_Nvdisc,Dtoset));
18201824
nv_adddisc(DOTSHNOD, shdiscnames, (Namval_t**)0);
@@ -1857,6 +1861,7 @@ Dt_t *sh_inittree(Shell_t *shp,const struct shtable2 *name_vals)
18571861
nbltins = n;
18581862
}
18591863
base_treep = treep = dtopen(&_Nvdisc,Dtoset);
1864+
dtuserdata(treep,shp,1);
18601865
treep->user = (void*)shp;
18611866
for(tp=name_vals;*tp->sh_name;tp++,np++)
18621867
{

src/cmd/ksh93/sh/macro.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,10 @@ static char *sh_tilde(Shell_t *shp,register const char *string)
27382738
skip:
27392739
#endif /* _WINIX */
27402740
if(!logins_tree)
2741+
{
27412742
logins_tree = dtopen(&_Nvdisc,Dtbag);
2743+
dtuserdata(logins_tree,shp,1);
2744+
}
27422745
if(np=nv_search(string,logins_tree,NV_ADD))
27432746
{
27442747
save = shp->subshell;

src/cmd/ksh93/sh/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ int sh_main(int ac, char *av[], Shinit_f userinit)
181181
/* preset aliases for interactive non-POSIX ksh */
182182
dtclose(shp->alias_tree);
183183
shp->alias_tree = sh_inittree(shp,shtab_aliases);
184+
dtuserdata(shp->alias_tree,shp,1);
184185
}
185186
}
186187
#if SHOPT_REMOTE

src/cmd/ksh93/sh/name.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
789789
{
790790
Dt_t *dp = dtview(shp->var_tree,(Dt_t*)0);
791791
rp->sdict = dtopen(&_Nvdisc,Dtoset);
792+
dtuserdata(rp->sdict,shp,1);
792793
dtview(rp->sdict,dp);
793794
dtview(shp->var_tree,rp->sdict);
794795
}
@@ -1131,7 +1132,10 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
11311132
ap = nv_arrayptr(np);
11321133
}
11331134
if(n && ap && !ap->table)
1135+
{
11341136
ap->table = dtopen(&_Nvdisc,Dtoset);
1137+
dtuserdata(ap->table,shp,1);
1138+
}
11351139
if(ap && ap->table && (nq=nv_search(sub,ap->table,n)))
11361140
nq->nvenv = (char*)np;
11371141
if(nq && nv_isnull(nq))
@@ -2285,6 +2289,7 @@ void sh_scope(Shell_t *shp, struct argnod *envlist, int fun)
22852289
newroot = nv_dict(shp->namespace);
22862290
#endif /* SHOPT_NAMESPACE */
22872291
newscope = dtopen(&_Nvdisc,Dtoset);
2292+
dtuserdata(newscope,shp,1);
22882293
if(envlist)
22892294
{
22902295
dtview(newscope,(Dt_t*)shp->var_tree);
@@ -3277,7 +3282,10 @@ int nv_rename(register Namval_t *np, int flags)
32773282
if(ap=nv_arrayptr(np))
32783283
{
32793284
if(!ap->table)
3285+
{
32803286
ap->table = dtopen(&_Nvdisc,Dtoset);
3287+
dtuserdata(ap->table,shp,1);
3288+
}
32813289
if(ap->table)
32823290
mp = nv_search(nv_getsub(np),ap->table,NV_ADD);
32833291
nv_arraychild(np,mp,0);

src/cmd/ksh93/sh/nvdisc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ static Namfun_t *clone_table(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp
12991299
Dt_t *oroot=tp->dict,*nroot=dtopen(&_Nvdisc,Dtoset);
13001300
if(!nroot)
13011301
return(0);
1302+
dtuserdata(nroot,dtuserdata(oroot,0,0),1);
13021303
memcpy((void*)ntp,(void*)fp,sizeof(struct table));
13031304
ntp->dict = nroot;
13041305
ntp->parent = nv_lastdict();

src/cmd/ksh93/sh/subshell.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ Dt_t *sh_subtracktree(int create)
404404
if(create && sh.subshell && !sh.subshare && sp && !sp->strack)
405405
{
406406
sp->strack = dtopen(&_Nvdisc,Dtset);
407+
dtuserdata(sp->strack,&sh,1);
407408
dtview(sp->strack,sh.track_tree);
408409
sh.track_tree = sp->strack;
409410
}
@@ -420,6 +421,7 @@ Dt_t *sh_subfuntree(int create)
420421
if(create && sh.subshell && !sh.subshare && sp && !sp->sfun)
421422
{
422423
sp->sfun = dtopen(&_Nvdisc,Dtoset);
424+
dtuserdata(sp->sfun,&sh,1);
423425
dtview(sp->sfun,sh.fun_tree);
424426
sh.fun_tree = sp->sfun;
425427
}

src/cmd/ksh93/sh/xec.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,7 @@ int sh_exec(register const Shnode_t *t, int flags)
24292429
else
24302430
{
24312431
root = dtopen(&_Nvdisc,Dtoset);
2432+
dtuserdata(root,shp,1);
24322433
nv_mount(np, (char*)0, root);
24332434
np->nvalue.cp = Empty;
24342435
dtview(root,shp->var_base);
@@ -2484,11 +2485,6 @@ int sh_exec(register const Shnode_t *t, int flags)
24842485
slp = (struct slnod*)np->nvenv;
24852486
sh_funstaks(slp->slchild,-1);
24862487
stakdelete(slp->slptr);
2487-
if(shp->funload)
2488-
{
2489-
free((void*)np->nvalue.rp);
2490-
np->nvalue.rp = 0;
2491-
}
24922488
if(rp->sdict)
24932489
{
24942490
Namval_t *mp, *nq;
@@ -2502,6 +2498,12 @@ int sh_exec(register const Shnode_t *t, int flags)
25022498
dtclose(rp->sdict);
25032499
rp->sdict = 0;
25042500
}
2501+
if(shp->funload)
2502+
{
2503+
if(!shp->fpathdict)
2504+
free((void*)np->nvalue.rp);
2505+
np->nvalue.rp = 0;
2506+
}
25052507
}
25062508
if(!np->nvalue.rp)
25072509
{
@@ -2540,7 +2542,10 @@ int sh_exec(register const Shnode_t *t, int flags)
25402542
if(!shp->fpathdict)
25412543
shp->fpathdict = dtopen(&_Rpdisc,Dtobag);
25422544
if(shp->fpathdict)
2545+
{
2546+
dtuserdata(shp->fpathdict,shp,1);
25432547
dtinsert(shp->fpathdict,rp);
2548+
}
25442549
}
25452550
}
25462551
else

src/lib/libast/Mamfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3964,6 +3964,14 @@ make install
39643964
prev cdt/dtopen.c
39653965
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtopen.c
39663966
done dtopen.o generated
3967+
make dtstat.o
3968+
make cdt/dtstat.c
3969+
prev cdt/dthdr.h implicit
3970+
done cdt/dtstat.c
3971+
meta dtstat.o %.c>%.o cdt/dtstat.c dtstat
3972+
prev cdt/dtstat.c
3973+
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtstat.c
3974+
done dtstat.o generated
39673975
make dtstrhash.o
39683976
make cdt/dtstrhash.c
39693977
prev cdt/dthdr.h implicit
@@ -3980,6 +3988,14 @@ make install
39803988
prev cdt/dttree.c
39813989
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dttree.c
39823990
done dttree.o generated
3991+
make dtuser.o
3992+
make cdt/dtuser.c
3993+
prev cdt/dthdr.h implicit
3994+
done cdt/dtuser.c
3995+
meta dtuser.o %.c>%.o cdt/dtuser.c dtuser
3996+
prev cdt/dtuser.c
3997+
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtuser.c
3998+
done dtuser.o generated
39833999
make dtview.o
39844000
make cdt/dtview.c
39854001
prev cdt/dthdr.h implicit
@@ -6095,7 +6111,7 @@ make install
60956111
exec - ${AR} rc libast.a streval.o strexpr.o strmatch.o strcopy.o modei.o modex.o strmode.o strlcat.o strlcpy.o strlook.o strncopy.o strsearch.o strpsearch.o stresc.o stropt.o strtape.o strpcmp.o strnpcmp.o strvcmp.o strnvcmp.o tok.o tokline.o tokscan.o pathaccess.o pathcat.o pathcanon.o pathcheck.o pathpath.o pathexists.o pathfind.o pathkey.o pathprobe.o pathrepl.o pathnative.o pathposix.o pathtemp.o pathtmp.o pathstat.o pathgetlink.o pathsetlink.o pathbin.o pathshell.o pathcd.o pathprog.o ftwalk.o ftwflags.o fts.o astintercept.o conformance.o getenv.o setenviron.o optget.o optjoin.o optesc.o optctx.o strsort.o struniq.o magic.o mime.o mimetype.o signal.o sigflag.o systrace.o error.o errorf.o errormsg.o errorx.o localeconv.o setlocale.o translate.o catopen.o iconv.o lc.o lctab.o mc.o base64.o recfmt.o recstr.o reclen.o fmtrec.o fmtbase.o fmtbuf.o fmtclock.o fmtdev.o fmtelapsed.o fmterror.o fmtesc.o fmtfmt.o fmtfs.o fmtident.o fmtint.o fmtip4.o fmtip6.o fmtls.o fmtmatch.o fmtmode.o fmtnum.o fmtperm.o fmtre.o fmttime.o
60966112
exec - ${AR} rc libast.a fmtuid.o fmtgid.o fmtsignal.o fmtscale.o fmttmx.o fmttv.o fmtversion.o strelapsed.o strperm.o struid.o strgid.o strtoip4.o strtoip6.o stack.o stk.o swapget.o swapmem.o swapop.o swapput.o sigdata.o sigcrit.o sigunblock.o procopen.o procclose.o procrun.o procfree.o tmdate.o tmequiv.o tmfix.o tmfmt.o tmform.o tmgoff.o tminit.o tmleap.o tmlex.o tmlocale.o tmmake.o tmpoff.o tmscan.o tmsleep.o tmtime.o tmtype.o tmweek.o tmword.o tmzone.o tmxdate.o tmxduration.o tmxfmt.o tmxgettime.o tmxleap.o tmxmake.o tmxscan.o tmxsettime.o tmxsleep.o tmxtime.o tmxtouch.o tvcmp.o tvgettime.o tvsettime.o tvsleep.o tvtouch.o cmdarg.o vecargs.o vecfile.o vecfree.o vecload.o vecstring.o univdata.o touch.o mnt.o debug.o memccpy.o memchr.o memcmp.o memcpy.o memdup.o memmove.o memset.o mkdir.o mkfifo.o mknod.o rmdir.o remove.o rename.o link.o unlink.o strdup.o strchr.o strrchr.o strstr.o strtod.o strtold.o strtol.o strtoll.o strtoul.o strtoull.o strton.o strtonll.o strntod.o strntold.o strnton.o
60976113
exec - ${AR} rc libast.a strntonll.o strntol.o strntoll.o strntoul.o strntoull.o strcasecmp.o strncasecmp.o strerror.o mktemp.o tmpnam.o fsync.o execlp.o execve.o execvp.o execvpe.o spawnveg.o vfork.o killpg.o hsearch.o tsearch.o getlogin.o putenv.o setenv.o unsetenv.o lstat.o statvfs.o eaccess.o gross.o omitted.o readlink.o symlink.o getpgrp.o setpgid.o setsid.o waitpid.o creat64.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.o getgroups.o mount.o system.o iblocks.o modedata.o tmdata.o memfatal.o sfkeyprintf.o sfdcdio.o sfdcdos.o sfdcfilter.o sfdcseekable.o sfdcslow.o sfdcsubstr.o sfdctee.o sfdcunion.o sfdcmore.o sfdcprefix.o wc.o wc2utf8.o basename.o closelog.o dirname.o fmtmsglib.o fnmatch.o ftw.o getdate.o getsubopt.o glob.o nftw.o openlog.o re_comp.o resolvepath.o realpath.o regcmp.o regexp.o setlogmask.o strftime.o strptime.o swab.o syslog.o tempnam.o wordexp.o mktime.o regalloc.o regclass.o regcoll.o regcomp.o regcache.o regdecomp.o regerror.o regexec.o regfatal.o reginit.o
6098-
exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstrhash.o dttree.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
6114+
exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstat.o dtstrhash.o dttree.o dtuser.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
60996115
exec - ${AR} rc libast.a _sfputu.o clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o fgetpos.o fgets.o fileno.o fopen.o fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o flockfile.o ftrylockfile.o funlockfile.o getc.o getchar.o getw.o pclose.o popen.o printf.o putc.o putchar.o puts.o putw.o rewind.o scanf.o setbuf.o setbuffer.o setlinebuf.o setvbuf.o snprintf.o sprintf.o sscanf.o asprintf.o vasprintf.o tmpfile.o ungetc.o vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o _doprnt.o _doscan.o _filbuf.o _flsbuf.o _stdfun.o _stdopen.o _stdprintf.o _stdscanf.o _stdsprnt.o _stdvbuf.o _stdvsnprnt.o _stdvsprnt.o _stdvsscn.o fgetwc.o fwprintf.o putwchar.o vfwscanf.o wprintf.o fgetws.o fwscanf.o swprintf.o vswprintf.o wscanf.o fputwc.o getwc.o swscanf.o vswscanf.o fputws.o getwchar.o ungetwc.o vwprintf.o fwide.o putwc.o vfwprintf.o vwscanf.o stdio_c99.o fcloseall.o fmemopen.o getdelim.o getline.o frexp.o frexpl.o astcopy.o
61006116
exec - ${AR} rc libast.a astconf.o astdynamic.o astlicense.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmexit.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.o sfstrtmp.o spawn.o
61016117
exec - (ranlib libast.a) >/dev/null 2>&1 || true

src/lib/libast/cdt/cdtlib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
/* This struct holds private method data created on DT_OPEN */
5959
struct _dtdata_s
6060
{ unsigned int lock; /* general dictionary lock */
61-
Dtuser_t user; /* application's data */
6261
unsigned int type; /* method type, control flags */
6362
ssize_t size; /* number of objects */
63+
Dtuser_t user; /* application's data */
6464
Dt_t dict; /* when DT_INDATA is requested */
6565
};
6666

@@ -123,7 +123,7 @@ typedef struct _dtlib_s
123123
#endif /* _BLD_cdt */
124124

125125
/* these macros lock/unlock dictionaries. DTRETURN substitutes for "return" */
126-
#define DTSETLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_SPINLOCK) : 0 )
126+
#define DTSETLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_LOCK) : 0 )
127127
#define DTCLRLOCK(dt) (((dt)->data->type&DT_SHARE) ? asolock(&(dt)->data->lock,1,ASO_UNLOCK) : 0 )
128128
#define DTRETURN(ob,rv) do { (ob) = (rv); goto dt_return; } while(0)
129129
#define DTERROR(dt, mesg) (!((dt)->disc && (dt)->disc->eventf) ? 0 : \

src/lib/libast/cdt/dtcomp.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,3 @@ extern ssize_t dtsize(Dt_t* d)
5252
{
5353
return (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT);
5454
}
55-
56-
#undef dtstat
57-
extern ssize_t dtstat(Dt_t* d)
58-
{
59-
return (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT);
60-
}

0 commit comments

Comments
 (0)