Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/timeout Cast signal argument of kill(2) to int, as s...



details:   https://anonhg.NetBSD.org/src/rev/40c163b64027
branches:  trunk
changeset: 331126:40c163b64027
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Aug 02 09:16:22 2014 +0000

description:
Cast signal argument of kill(2) to int, as sig_atomic_t may be larger.
Avoids:
src/usr.bin/timeout/timeout.c:331:5: error: conversion to 'int' from 'sig_atomic_t' may alter its value [-Werror=conversion]
     kill(pid, sig_term);
     ^
warning from gcc 4.8

diffstat:

 usr.bin/timeout/timeout.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0306e7cdb580 -r 40c163b64027 usr.bin/timeout/timeout.c
--- a/usr.bin/timeout/timeout.c Sat Aug 02 07:20:08 2014 +0000
+++ b/usr.bin/timeout/timeout.c Sat Aug 02 09:16:22 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: timeout.c,v 1.2 2014/08/01 14:01:30 christos Exp $ */
+/* $NetBSD: timeout.c,v 1.3 2014/08/02 09:16:22 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 Baptiste Daroussin <bapt%FreeBSD.org@localhost>
@@ -32,7 +32,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/usr.bin/timeout/timeout.c 268763 2014-07-16 13:52:05Z bapt $");
 #else
-__RCSID("$NetBSD: timeout.c,v 1.2 2014/08/01 14:01:30 christos Exp $");
+__RCSID("$NetBSD: timeout.c,v 1.3 2014/08/02 09:16:22 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -328,7 +328,7 @@
                        if (!foreground)
                                killpg(pgid, killsig);
                        else
-                               kill(pid, sig_term);
+                               kill(pid, (int)sig_term);
 
                        if (do_second_kill) {
                                set_interval(second_kill);



Home | Main Index | Thread Index | Old Index