On Thu, 06 Aug 2009 12:31:24 +0100
Alan Maguire <Alan.Maguire at Sun.COM> wrote:
> Michael Hunter wrote:
> > On each iteration through this loop we could set err but then
> > continue. When we exit the loop we return an error although one that
> > we might have continued past. If we can continue past it should we
> > return it? If we return it should we just stop at that point?
> >
> >
> I think it's no harm to return it - the error can be logged
> by nwamd then - but it should definitely be continued
> past, since if we don't, a single failure writing
> to one event queue (could just be an nwamadm
> show-events) would prevent all other event queues
> from working.
I'm seeing a EPERM return from this function a lot. It is hard to tell
what that came from. Most likely it doesn't matter. The log message
without being tired to what really happened is useless.
mph
>
> Alan
> > mph
> >
> > [...]
> > while ((dp = readdir(dirp)) != NULL) {
> > if (strncmp(dp->d_name, NWAM_EVENT_MSG_FILE,
> > strlen(NWAM_EVENT_MSG_FILE)) != 0)
> > continue;
> >
> > (void) snprintf(eventmsgfile, sizeof (eventmsgfile),
> > "%s/%s",
> > NWAM_EVENT_MSG_DIR, dp->d_name);
> >
> > if ((key = ftok(eventmsgfile, 0)) == -1) {
> > err = nwam_errno_to_nwam_error(errno);
> > continue;
> > }
> >
> > if ((msqid = msgget(key, 0644)) == -1) {
> > err = nwam_errno_to_nwam_error(errno);
> > continue;
> > }
> >
> > [...a series of like statements...]
> >
> > /*
> > * This shouldn't ever block but if it does it is
> > catastrophic.
> > */
> > if (msgsnd(msqid, (struct msgbuf *)event, event->size,
> > IPC_NOWAIT) == -1) {
> > assert(errno != EAGAIN);
> > err = nwam_errno_to_nwam_error(errno);
> > continue;
> > }
> >
> > }
> > (void) closedir(dirp);
> >
> > return (err);
> > _______________________________________________
> > nwam-dev mailing list
> > nwam-dev at opensolaris.org
> > http://mail.opensolaris.org/mailman/listinfo/nwam-dev
> >
>