Skip to content

Instantly share code, notes, and snippets.

@ThomasLocke
Created November 24, 2011 21:07
Show Gist options
  • Save ThomasLocke/1392295 to your computer and use it in GitHub Desktop.
Save ThomasLocke/1392295 to your computer and use it in GitHub Desktop.
Patch for gnatcoll-traces-syslog.adb that fix a segfault
--- gnatlib/src/syslog/gnatcoll-traces-syslog.adb 2011-11-24 21:42:54.680002883 +0100
+++ gnatlib_new/src/syslog/gnatcoll-traces-syslog.adb 2011-11-24 12:10:24.080001517 +0100
@@ -80,8 +80,6 @@
-- we need to be able to combine levels and facilities in the call
-- to syslog...
- Percent_S : constant String := "%s" & ASCII.NUL;
-
type Syslog_Stream_Record is new Trace_Stream_Record with record
Buffer : Unbounded_String;
Facility : Facilities;
@@ -217,16 +215,16 @@
Level : Levels := Emergency;
Message : String)
is
- procedure Internal
- (Priority : Integer;
- Message : String;
- Arg : String);
- pragma Import (C, Internal, "syslog");
- -- Low-level binding
- begin
- Internal (Levels_To_Integer (Level) + Facilities_To_Integer (Facility),
- Percent_S,
- Message & ASCII.NUL);
+ procedure Syslog_Wrapper
+ (Priority : Integer;
+ Log_Message : String);
+ pragma Import (C, Syslog_Wrapper, "syslog_wrapper");
+ -- Imported from src/syslog_wrapper.c
+ begin
+ Syslog_Wrapper
+ (Priority =>
+ Levels_To_Integer (Level) + Facilities_To_Integer (Facility),
+ Log_Message => Message & ASCII.NUL);
end Syslog;
--------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment