]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: Do not call exit from within the main library
authorDhaval Giani <dhaval.giani@gmail.com>
Fri, 4 Jun 2010 11:30:58 +0000 (13:30 +0200)
committerDhaval Giani <dhaval.giani@gmail.com>
Fri, 4 Jun 2010 11:39:18 +0000 (13:39 +0200)
The autogenerated code fromt the lexer was calling exit on a
fatal error. Do not do that. Instead log the message.

While it is still not clear if this is the correct response
for YY_FATAL_ERROR, we need to gracefully handle errors, and
since this is a path which is very rarely hit, this is still
a low risk change and so we will merge it.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
src/lex.l

index 6291b5536f398a542e2208a08fb63cf6417fce78..2f4e3132f06d39456e7f23f31bb677c0b8722e48 100644 (file)
--- a/src/lex.l
+++ b/src/lex.l
 
 %{
 #include <string.h>
+#include <libcgroup.h>
+#include <libcgroup-internal.h>
 #include "parse.h"
 int line_no = 1;
 
+#define YY_FATAL_ERROR(msg) cgroup_dbg(%s)
 %}
 
 %%