<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include "src/ofbis.h"

#define BLITTEST
#define CHARTEST
#undef CMAPTEST
#define EVENTTEST
#undef DUMPTEST

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

FB	*f;

static void signal_handler(int sig)
{
  fprintf(stderr,"fbtst: signal %d caught and exits program!\n", sig);
  FBclose(f);;
  exit(1);
}
      
static void setup_signals()
{
  sigset_t mask;
  struct sigaction sigs;
          
  sigemptyset(&mask);
            
  sigs.sa_handler = signal_handler;
  sigs.sa_mask = mask;
  sigs.sa_flags = SA_ONESHOT;
  sigs.sa_restorer = NULL;
             
  sigaction(SIGHUP, &sigs, NULL);
  sigaction(SIGINT, &sigs, NULL);<commit_msg>* Some platforms doesn't have the sa_restorer field.   Patch by <NAME> <<EMAIL>>.<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include "src/ofbis.h"

#define BLITTEST
#define CHARTEST
#undef CMAPTEST
#define EVENTTEST
#undef DUMPTEST

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

FB	*f;

static void signal_handler(int sig)
{
  fprintf(stderr,"fbtst: signal %d caught and exits program!\n", sig);
  FBclose(f);;
  exit(1);
}
      
static void setup_signals()
{
  sigset_t mask;
  struct sigaction sigs;
          
  sigemptyset(&mask);
  
  memset(&sigs,0,sizeof(sigs));
  sigs.sa_handler = signal_handler;
  sigs.sa_mask = mask;
  sigs.sa_flags = SA_ONESHOT;
             
  sigaction(SIGHUP, &sigs, NULL);
  sigaction(SIGINT, &sigs, NULL);
{'fraction_non_alphanumeric': 0.16299559471365638, 'fraction_numerical': 0.0018879798615481435, 'mean_word_length': 4.031645569620253, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3323512', 'n_tokens_mistral': 660, 'n_tokens_neox': 641, 'n_words': 141}