Also I noted that the bug I reported isn't fixed. Here's the post again.
I got mail back from Jie Chen stating it was a bug and would be fixed in
the next release.
Kim
> All,
> I've been tracing the code trying to figure out why something of mine fails
> and I found the following code that seems like it might not be doing the
> correct thing.
> The following is cdevDevice::attachPtr. When I trace into the code
> the device class is looked up. If it is found and it is not a collection
> a new cdevDevice is created in "system". Then it goes to the next
> line and creates another cdevDevice (the //unknown device comment).
> Is this really the desired behavior? I'm wondering if there should be
> a return inside the "CDEV_SUCCESS" clause or an "else" for the no success
> case.
>
> Just wondering,
> Kim
>
> cdevDevice *
> cdevDevice::attachPtr (char *name, cdevSystem& system)
> {
> cdevDevice *dev = 0;
> cdevService *service = 0;
>
> if (system.deviceCreated (name)){
> dev = system.device (name);
> dev->refCount_ ++;
> }
> else{
> cdevData data, result;
> data.insert("device",name);
> int status = (system.nameServer()).send("queryClass",data,result);
> if (status==CDEV_SUCCESS) { // device is defined in directory
> char *name;
> result.find("value",(void* &)name);
> if (::strcmp(name,"collection")==0) // is it a collection?
> dev = new cdevCollection (name, system); // yes
> else
> dev = new cdevDevice (name, system); // no, it is a known simple
device
> }
> dev = new cdevDevice (name, system); // unknown device
> }
> return dev;
> }
>
>