summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess/testProcessHang/main.cpp
blob: bbfc7af19da7120c5dd065baa9989782613d4752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include <stdio.h>

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#  include <windows.h>

void sleepForever()
{
    ::Sleep(INFINITE);
}
#else
#  include <unistd.h>

void sleepForever()
{
    ::pause();
}
#endif

int main()
{
    puts("ready.");
    fflush(stdout);
    fprintf(stderr, "ready.\n");
    fflush(stderr);

    // sleep forever, simulating a hung application
    sleepForever();
    return 0;
}