• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 27761028812

18 Jun 2026 12:57PM UTC coverage: 50.373% (-0.4%) from 50.749%
27761028812

push

github

Flow86
Address PR feedback

0 of 3 new or added lines in 2 files covered. (0.0%)

5 existing lines in 2 files now uncovered.

23180 of 46017 relevant lines covered (50.37%)

44640.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/s25main/SignalHandler.cpp
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#include "SignalHandler.h"
6
#include "GlobalVars.h"
7
#ifndef _WIN32
8
#    include <boost/nowide/iostream.hpp>
9
#    include <csignal>
10
#    include <cstdio>
11
#    include <cstdlib>
12
#endif // !_WIN32
13

14
/**
15
 *  Signal-Handler
16
 */
17
#ifdef _WIN32
18
BOOL WINAPI ConsoleSignalHandler(DWORD dwCtrlType)
19
{
20
    switch(dwCtrlType)
21
    {
22
        case CTRL_BREAK_EVENT:
23
        case CTRL_CLOSE_EVENT:
24
        case CTRL_C_EVENT:
25
        {
26
            GLOBALVARS.notdone = false;
27
            return TRUE;
28
        }
29
        break;
30
    }
31
    return FALSE;
32
}
33
#else
34
bool killme = false;
35
void ConsoleSignalHandler(int sig)
×
36
{
37
    if(sig == SIGINT)
×
38
    {
39
        if(!killme)
×
NEW
40
            boost::nowide::cerr << "Do you really want to terminate the program (y/n) : ";
×
41
        else
NEW
42
            boost::nowide::cerr << "Do you really want to kill the program (y/n) : ";
×
43

44
        int c = getchar();
×
45
        if(c == 'j' || c == 'y' || c == 1079565930)
×
46
        {
47
            if(killme)
×
48
                exit(1);
×
49

50
            killme = true;
×
51
            GLOBALVARS.notdone = false;
×
52
        }
53
    }
54
}
×
55
#endif // _WIN32
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc