Re: XForms: outb()) error:outb(inb(0x61) & ~3, 0x61); fl_finish(); produces: select: Bad file numbe

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 3 Apr 98 05:47:37 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> does anyone have experience talking to the hardware using an xforms app?
> I got a seg violation and wonder if this error is related to the forms library.
> [...]
> void s_cb(FL_OBJECT *ob, long c){
> if (c>=1 && c<=9) sound(f[c-1]);
> else { nosound(),
> #if 0
> fl_finish(); /* seg fault */
> #else
> exit(0); /* ok */
> #endif
> }
> }

I think the problem here is not related to hardware but to the fact
that you're calling fl_finish() from a callback function and then
returning.

The primary purpose of fl_finish() is to clean up any modifications
that XForms has made to the server defaults in the case of a callback
activated by a shortcut. The fl_finish() should be more or less
immediately followed by an exit(), since as a side effect the server
connection is also shut down.

You should not return to the XForms main loop from the callback.

Code

fl_finish();
exit( 0 );

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/