1
0
mirror of https://github.com/dennypage/dpinger.git synced 2024-05-19 06:50:01 +00:00

4 Commits
v3.0 ... v3.2

Author SHA1 Message Date
Denny Page
efc17c7204 Log signal number on exit 2022-02-28 10:07:30 -08:00
Denny Page
bc00923f62 Update text formatting to match current GitHub format. No change to actual license. 2020-06-07 13:29:36 -07:00
Denny Page
bf18a6e2a8 Update copyright 2020-06-07 13:23:33 -07:00
Denny Page
cee7ac9da0 Add a version number to usage output 2017-12-08 21:37:23 -08:00
2 changed files with 30 additions and 27 deletions

13
LICENSE
View File

@@ -1,15 +1,15 @@
Copyright (c) 2015-2017, Denny Page
Copyright (c) 2015-2020, Denny Page
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -21,4 +21,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,6 +1,6 @@
//
// Copyright (c) 2015-2017, Denny Page
// Copyright (c) 2015-2022, Denny Page
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -190,25 +190,6 @@ static uint16_t sequence_limit;
// Receive thread ready
static unsigned int recv_ready = 0;
//
// Termination handler
//
__attribute__ ((noreturn))
static void
term_handler(void)
{
// NB: This function may be simultaneously invoked by multiple threads
if (usocket_name)
{
(void) unlink(usocket_name);
}
if (pidfile_name)
{
(void) unlink(pidfile_name);
}
exit(0);
}
//
// Log for abnormal events
@@ -234,6 +215,28 @@ logger(
}
//
// Termination handler
//
__attribute__ ((noreturn))
static void
term_handler(
int signum)
{
// NB: This function may be simultaneously invoked by multiple threads
if (usocket_name)
{
(void) unlink(usocket_name);
}
if (pidfile_name)
{
(void) unlink(pidfile_name);
}
logger("exiting on signal %d\n", signum);
exit(0);
}
//
// Compute checksum for ICMP
//
@@ -840,6 +843,7 @@ get_length_arg(
static void
usage(void)
{
fprintf(stderr, "Dpinger version 3.2\n\n");
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s [-f] [-R] [-S] [-P] [-B bind_addr] [-s send_interval] [-l loss_interval] [-t time_period] [-r report_interval] [-d data_length] [-o output_file] [-A alert_interval] [-D latency_alarm] [-L loss_alarm] [-C alert_cmd] [-i identifier] [-u usocket] [-p pidfile] dest_addr\n\n", progname);
fprintf(stderr, " options:\n");