From c8ad87debbf33046c103e074a066f170a84d4edb Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Thu, 7 Mar 2002 14:11:41 +0000 Subject: [PATCH] Revert/fix the most controversial parts of the last commit: 1) place __FBSDID() correctly IAW style(9). 2) revert (and slightly correct) a "complex" expression in an if() statement. --- usr.bin/rwall/rwall.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c index f40aa6666aca..ea5f77e5b7ca 100644 --- a/usr.bin/rwall/rwall.c +++ b/usr.bin/rwall/rwall.c @@ -32,10 +32,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1988 Regents of the University of California.\n\ @@ -46,6 +42,9 @@ static const char copyright[] = static const char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91"; #endif +#include +__FBSDID("$FreeBSD$"); + /* * This program is not related to David Wall, whose Stanford Ph.D. thesis * is entitled "Mechanisms for Broadcast and Selective Broadcast". @@ -136,9 +135,7 @@ makemsg(const char *fname) const char *whom; snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); - fd = mkstemp(tmpname); - fp = fdopen(fd, "r+"); - if (fd == -1 || !fp) + if ((fd = mkstemp(tmpname)) == -1 || (fp = fdopen(fd, "r+")) == NULL) err(1, "can't open temporary file"); unlink(tmpname);