HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

AIX Getty Feature.., attempted fix



Hi,

I run HylaFax on AIX.  I also happen to be the guy that put together the last
binary dist for it, and am working on a binary dist for 4.0pl2 .

Something has bothered me for ever with HylaFax, and I decided to fix it once
and for all.

With 64 port concentrators and 128 port boards, the tty's are actually logged in
utmp with the device ending in a "/0".  For example, the getty running on 
tty5 will have a utmp entry of tty5/0.

You can't run a getty on tty5/0, it has to run on tty5, so the Linux convention
of using _'s in the filenames won't work.

For incoming calls, this always leaves a utmp entry around after the call is 
finished.  I have lived with this, but now I want to fix it.  I can fix it 
easily if I revert to my C experience, but I am trying to do it using the 
C++ & Sam's fxStr class.

The code that concerns me is in ...faxd/GettySysV.c++, in SysVGetty::hangup().

The original code is:

----
    while ((ut = getutent()) != NULL) { 
	if (!strneq(ut->ut_line, getLine(), sizeof (ut->ut_line)))
	    continue;
----

What happens is that the getutent returns tty5/0, while getLine returns tty5,
and thus a match is never made.

in C, I would just ( which I have done & it works )
----
	char alt_dev[256];

	strcpy(alt_dev,getLine());
	strcat(alt_dev,"/0");

	if (!strneq(ut->ut_line, getLine(), sizeof (ut->ut_line)) && 
	    !strneq(ut->ut_line, alt_dev, sizeof(ut->ut_line)))
----

I want to change it to be something like, where it used the concatenation
functions of fxStr:

----
    char *device=getLine();

    while ((ut = getutent()) != NULL) { 
	if (!strneq(ut->ut_line, device, sizeof (ut->ut_line)) && 
	    !strneq(ut->ut_line, device|"/0", sizeof (ut->ut_line)))
			            ^^^^^^^^
----

But this doesn't compile ( understandably so, because neither of the items 
around the "|" are fxStr's, so it's not going to know what the heck to do.

Any C++ Programmers that can help me out a wee bit?  I'd like a "proper" 
solution worth submitting as a patch for future releases.

Thanks for any input...
-- 
	Steve Williams, Calgary, Alberta, Canada
	Genie Computer Systems Inc.
	steve@genie96.com

"A man doesn't begin to attain wisdom until he recognizes that he is 
 no longer indespensable."
- Admiral Richard E. Byrd ( 1888-1957 )




Project hosted by iFAX Solutions