🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #781

IV/Unidraw and interrupts.....

#781
From: Anthony Utano
Date: Tue, 06 Oct 1992 01:59
105 lines
2864 bytes
Hi all,


	I have a program built using Unidraw which is uses a 
	set of routines for interprocess communication. These 
	routines work fine when in a non Unidraw application,
	but the parts which involve the Unidraw appliaction 
	receiving data don't seem to work.

	On further exploration, i found that our routines needed
	Interrupts to work, so I checked these out. It seems that
	Unidraw takes over the Interrupts before anything else is done,
	i.e even before the main function ???

	Any hints from anyone 
	Anthony




	Here is most of my code

	IE. This works fine


	#include <stream.h>
	#include <signal.h>
	#include <stdlib.h>

	/*****************************************************************************/
	void myinthandle0(int sig,int code,struct sigcontext *scp, char* addr)
	{
		cerr << "#######Interupt......" << endl;
	}	

	int main (int argc, char** argv) {

        cerr << "Turning signal #2 off...." << endl;
        signal(SIGTERM,SIG_IGN);
        sleep(5);
        cerr << "On......." << endl;
        signal(SIGTERM,myinthandle0);
        sleep(5);
	} 


	BUT This ignores my handler.........??????


	
/*
 * Ned editor main program.
 */

#include "nedcatalog.h"
#include "nedcreator.h"
#include "neded.h"
#include "nedpal.h"
#include <Unidraw/unidraw.h>
#include <InterViews/world.h>
#include <stream.h>
#include <signal.h>

/* was defn for PropertyData properties here .... */

void myinthandle0(int sig,int code,struct sigcontext *scp, char* addr)
{
  cerr << "#######Interupt......" << endl;
  exit(-33);
}


int main (int argc, char** argv) {
  int exit_status = 0;
  NedCreator creator;

  cerr << "Turning signal #2 off...." << endl;
  signal(SIGTERM,SIG_IGN);
  sleep(5);
  cerr << "On......." << endl;
  signal(SIGTERM,myinthandle0);
  sleep(5);

  Unidraw* unidraw = new Unidraw(
      new NedCatalog("ned", &creator), argc, argv, options, properties
  );

  if (argc > 2) {
    cerr << "Usage: " << argv[0] << " [file]" << "\n";
    exit_status = 1;

  } else {

    const char* initial_file = (argc == 2) ? argv[1] : nil;
    NedEditor* ed = new NedEditor(initial_file);

    ToolPalette* ted = new ToolPalette(ed);

    unidraw->Open(ted);
    unidraw->Open(ed);
    unidraw->Run();
  }
  delete unidraw;
  return exit_status;
}
Technical Details
Message-ID: <1992Oct6.015932.557@trl.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!titan!cassiopeia!utano

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!titan!cassiopeia!utano
From: utano@cassiopeia.trl.OZ.AU (Anthony Utano)
Subject: IV/Unidraw and interrupts.....
Message-ID: <1992Oct6.015932.557@trl.oz.au>
Summary: Problem accessing interrupts with IV program
Keywords: InterViews, Unidraw, Interrupts
Sender: root@trl.oz.au (System PRIVILEGED Account)
Organization: Telecom Research Labs, Melbourne, Australia
Date: Tue, 6 Oct 1992 01:59:32 GMT
Lines: 127