summaryrefslogtreecommitdiffstats
path: root/usr.bin/rwall/rwall.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-07 14:11:41 +0000
committermarkm <markm@FreeBSD.org>2002-03-07 14:11:41 +0000
commitc285f79bbb1da0847c37f6c48e740d237c993472 (patch)
tree8935d8cfd9d729880df3a69e929ddb7f387d3b3f /usr.bin/rwall/rwall.c
parent43cc55dd2fb8fc69429d9265f32323612073e91f (diff)
downloadFreeBSD-src-c285f79bbb1da0847c37f6c48e740d237c993472.zip
FreeBSD-src-c285f79bbb1da0847c37f6c48e740d237c993472.tar.gz
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.
Diffstat (limited to 'usr.bin/rwall/rwall.c')
-rw-r--r--usr.bin/rwall/rwall.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index f40aa66..ea5f77e 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -32,10 +32,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-
-__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 <sys/cdefs.h>
+__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);
OpenPOWER on IntegriCloud