comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: GNAT and SIGTERM (Linux x86_64)
Date: Wed, 27 Oct 2010 00:43:26 -0700 (PDT)
Date: 2010-10-27T00:43:26-07:00	[thread overview]
Message-ID: <2d4bca6e-f38d-4bf4-9262-203287284e52@f33g2000yqh.googlegroups.com> (raw)
In-Reply-To: op.vk6y3kwxule2fv@garhos

Yannick Duchêne wrote on comp.lang.ada:
> Signal_Handler is a type, and a type does not live on its own. To make it  
> “real”, you have to instantiate an entity of that type.

Good catch.

> In few word : in Entry_Point, you forget to declare a variable of type  
> Signal_Handler.
>
> Try this :
>
>   procedure Entry_Point is
>      Shutdown_Flag : Boolean := False;
>      Handler : Signal_Handler; -- < Add this line
>   begin
>      [... remaining of you cool stuff]
>   end Entry_Point;
>
> It works :)

Or, simply remove the "type" keyword from the declaration of
Signal_Handler, i.e.

--- signals.ads before
+++ signals.ads after
@@ -6,6 +6,6 @@
 with Ada.Interrupts.Names; use Ada.Interrupts.Names;
 package Signals is
   pragma Unreserve_All_Interrupts;
-  protected type Signal_Handler is
+  protected Signal_Handler is
     procedure Handle_SIGTERM;
     pragma Attach_Handler(Handle_SIGTERM, SIGTERM);
     pragma Interrupt_State (SIGTERM, System);

--
Ludovic Brenta.
I love hand-writing unified diffs in the morning.



  reply	other threads:[~2010-10-27  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 15:52 GNAT and SIGTERM (Linux x86_64) Bryan
2010-10-26 16:36 ` Yannick Duchêne (Hibou57)
2010-10-27  7:43   ` Ludovic Brenta [this message]
2010-10-27 14:21     ` Bryan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox