Navigation Menu

Skip to content

Commit

Permalink
[tools] Housekeeping
Browse files Browse the repository at this point in the history
Set stopped flag when a signal is caught.
  • Loading branch information
monich committed Aug 24, 2019
1 parent 0351ef4 commit a3c6997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/ndef-read/ndef-read.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018 Jolla Ltd.
* Copyright (C) 2018 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
Expand All @@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand Down Expand Up @@ -62,6 +62,7 @@ read_ndef_signal(
AppData* app = user_data;

if (!app->stopped) {
app->stopped = TRUE;
GDEBUG("Signal caught, shutting down...");
g_main_loop_quit(app->loop);
}
Expand Down
1 change: 1 addition & 0 deletions tools/ndef-write/ndef-write.c
Expand Up @@ -66,6 +66,7 @@ write_ndef_signal(
AppData* app = user_data;

if (!app->stopped) {
app->stopped = TRUE;
GDEBUG("Signal caught, shutting down...");
g_main_loop_quit(app->loop);
}
Expand Down

0 comments on commit a3c6997

Please sign in to comment.